Fix/syncs for tags categories #1456
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes a critical bug where tags and categories added to media items were not immediately searchable, and improves the user experience by sorting tags and categories alphabetically throughout the frontend.
Bug Fix: Immediate Search Vector Updates for Tags and Categories
Previously, when tags or categories were added to media items via M2M relationships, the search vectors were not updated until the media item was edited a second time. This meant that newly tagged media would not appear in search results until manually re-saved.
Changes:
m2m_changed) forMedia.tagsandMedia.categoryrelationships that automatically update search vectors and tag/category media counts when relationships changepost_add,post_remove, andpost_clearactions using thepk_setparameter to identify affected tags/categoriesMediaBulkUserActions) to ensure consistencyedit_mediaview to ensure changes are immediately reflectedFixes: #1207
Enhancement: Alphabetical Sorting of Tags and Categories
To improve usability and make tags/categories easier to find and scan, all tag and category lists are now sorted alphabetically (case-insensitive).
Changes:
Media.tags_infoandMedia.categories_infoproperties to return sorted lists alphabetically by titleBulkActionTagModalcomponent to sort tags alphabetically in both left (available tags) and right (selected tags) panelsSteps
Pre-deploy
Post-deploy