1

Tags' Usage Count field - please fix the bugs

Hi there,

 
Playing with Tags on v7.5.2, it seems that the Usage Count field for a Tag is incorrect and confusing.
 
For example, we currently have a tag named “rblau”  Guess who created it?  ;-)
  • For that Tag, the Usage Count field reports 56.  Ok...
  • But if I create a page with the filter “Show Pages (where) Tags includes rblau”, I only get 16.  (Maybe some of those pages are just detail tabs and thus maybe excluded, but still a difference of 40 seems like a lot.)
  • Even weirder, if I run an API query like the following (where sg is a normally-created shotgun connection object), there are 27 "active" tagged Pages and 25 "trashed" tagged Pages, for a total of 52.
tag_name = "rblau"
tagged = {}
for entity, fields in sg.schema_read().items():
    if ‘tags’ in fields:
        active = sg.find(entity, [(’tags’, ’name_contains’, tag_name)])
        trashed = sg.find(entity, [(’tags’, ’name_contains’, tag_name)], retired_only=True)
        if active or trashed:
            tagged[entity] = {‘active’: active, ‘trashed’: trashed}
  • Perhaps weirdest of all, looking at the raw SQL database (we're locally hosted), the taggings table shows 80 Pages tagged with that Tag.  No other entities, just those 80 pages, which I confirmed are all unique page IDs.
Is the Usage Count excluding entities that have been Trashed?
 
How should we account for the differences between the UI Usage Count (56) and the Detail Page (16) and the API query (52) and the raw SQL taggings (80)?
 
My expectation is that Usage Count and a Pages-with-this-Tag UI filter should at least return the same number, probably the count of all non-retired entities (27?).  At least until Shotgun can return a pop-up window of all the tagged entities and presumably group / sort them by Trashed or not (see https://support.shotgunsoftware.com/hc/en-us/community/posts/115007459473).  Although I guess Shotgun never returns a page including both non-trashed and Trashed entities (never mind more than 1 entity type), except for the actual Trash pages, and so again the Tag Usage Count should probably never include Trashed entities.
 

2 comments

  • 0
    Avatar
    Brandon Foster

    Hey Tony,

    Thanks for the breakdown. I'll need to follow up with our engineers to figure out how we're calculating the count which is displayed. Off the top of my head, one potential item which may be causing a discrepancy is accounting for Tags in use within Archived Projects. It's possible those aren't included as part of the count displayed in the UI (but you'd still see if looking directly in the database).

  • 0
    Avatar
    Brandon Foster

    Hey Tony,

    I'm spawning a support ticket from this so we can investigate on your site directly.

Please sign in to leave a comment.