[PATCH] Optional case-insensitivity for tag cloud and tag query
|Reported by:||AllenB||Owned by:|
Tickets #4200 and #4799 partially address the ability to make tags case-insensitive. However, neither of those solutions is complete. The attached patch enhances the TagsPlugin with the ability to make tag queries and the tag cloud case-sensitive or case-insensitive. These case-insensitivity enhancements are divided into three categories and each is individually configurable by the user. If these new settings are left to their defaults, the behavior should be identical to the current behavior (which should avoid disrupting any existing installations).
The following trac.ini settings are used to control this feature:
[tags] # Treat tag queries as case-sensitive (default=true) case_sensitive_queries = false # Use a case-sensitive sort for the tag cloud (default=true) cloud_sort_by_case = false # Cloud view should combine tags that differ only in case (default=false) cloud_combine_similar = true
Say you have three tickets. Ticket #1 has the keyword 'write', ticket #2 has the keyword 'WRITE', and ticket #3 has the keyword 'Write'. The system also has other tickets/wiki pages with various other tags/keywords.
The default behavior of the tag cloud is to list all three tags individually. 'WRITE' and 'Write' would be listed in the first half of the tag cloud with other tags that start with capital letters, and 'write' would be listed near the end of the tag cloud. Clicking on one of the tags would take you to a tag query page that lists only the ticket that uses that particular capitalization scheme for the keyword.
If you set the 'case_sensitive_queries' option to 'false', then clicking on any of the "write" tags would take you to a tag query page that lists all three tickets.
If you set the 'cloud_sort_by_case' flag to 'false', then the tag cloud would list 'WRITE', 'Write', and 'write' next to each other.
If you set the 'cloud_combine_similar' flag to 'true', then there would only be a single "WRITE" tag listed instead of three. Hovering the mouse over that unified tag would display a tooltip showing a count of three.
Potential Configuration Problem
If the user sets 'cloud_combine_similar' to 'false' and 'case_sensitive_queries' to 'true', then there can potentially be tags that aren't accessible from the tag cloud. Querying for those tags individually will still work, however.
Change History (7)
Changed 5 years ago by AllenB
comment:2 Changed 5 years ago by hasienda
- Cc otaku42 added; anonymous removed
- Keywords casing query added
- Owner changed from otaku42 to hasienda