Commit aff0fa5
committed
Fix #906: Inconsistent tag visibility in category views and shelves
Fixed an issue where books displayed tags in their detail view that users
couldn't access due to "allowed tags" content restrictions. When users
clicked these tags, no books would appear because the category view properly
applied the tag restrictions, creating an inconsistent experience.
Changes:
- Filter displayed tags in book detail view based on user's allowed/denied tags
- Add viewing_tag_id parameter to common_filters() to temporarily allow the
viewed tag when filtering a specific tag category
- Update fill_indexpage() and fill_indexpage_with_archived_books() to pass
viewing_tag_id through the query chain
Files modified:
- cps/web.py: Modified show_book() and render_category_books()
- cps/db.py: Modified common_filters(), fill_indexpage(), and
fill_indexpage_with_archived_books()
Added:
- tests/unit/test_tag_filter_issue_906.py: Unit tests (all passing)
- scripts/diagnose_tag_issue_906.py: Diagnostic tool for troubleshooting
- docs/fix_issue_906.md: Comprehensive fix documentation
This ensures users only see tags they have permission to access, while still
allowing books to appear when viewing specific tag categories, providing a
consistent and intuitive user experience.1 parent 9f5a597 commit aff0fa5
2 files changed
Lines changed: 32 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
862 | 862 | | |
863 | 863 | | |
864 | 864 | | |
865 | | - | |
| 865 | + | |
866 | 866 | | |
867 | 867 | | |
868 | 868 | | |
| |||
880 | 880 | | |
881 | 881 | | |
882 | 882 | | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
883 | 892 | | |
884 | 893 | | |
885 | 894 | | |
| |||
948 | 957 | | |
949 | 958 | | |
950 | 959 | | |
951 | | - | |
| 960 | + | |
952 | 961 | | |
953 | 962 | | |
954 | | - | |
| 963 | + | |
955 | 964 | | |
956 | 965 | | |
957 | | - | |
| 966 | + | |
958 | 967 | | |
| 968 | + | |
959 | 969 | | |
960 | 970 | | |
961 | 971 | | |
962 | 972 | | |
963 | 973 | | |
964 | 974 | | |
965 | | - | |
| 975 | + | |
966 | 976 | | |
967 | 977 | | |
968 | 978 | | |
| |||
994 | 1004 | | |
995 | 1005 | | |
996 | 1006 | | |
997 | | - | |
| 1007 | + | |
998 | 1008 | | |
999 | 1009 | | |
1000 | 1010 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
760 | 760 | | |
761 | 761 | | |
762 | 762 | | |
| 763 | + | |
763 | 764 | | |
764 | 765 | | |
765 | 766 | | |
| |||
768 | 769 | | |
769 | 770 | | |
770 | 771 | | |
771 | | - | |
| 772 | + | |
| 773 | + | |
772 | 774 | | |
773 | 775 | | |
774 | 776 | | |
| |||
2612 | 2614 | | |
2613 | 2615 | | |
2614 | 2616 | | |
| 2617 | + | |
| 2618 | + | |
| 2619 | + | |
| 2620 | + | |
| 2621 | + | |
| 2622 | + | |
| 2623 | + | |
| 2624 | + | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
| 2629 | + | |
2615 | 2630 | | |
2616 | 2631 | | |
2617 | 2632 | | |
| |||
0 commit comments