Drupal 7, Tags, Unpublished Content, and You

Drupal has a very flexible taxonomy system for tagging and categorization content (and users, and anything else). This flexibility is one of its interesting differentiating features — you can create as many dimensions of categorization and tagging as you like, which is very attractive for librarians and other enthusiasts of organization. To keep that flexibility from totally bogging down the system, Drupal maintains an index table that maps those terms onto the pieces of content to which they're attached.

Today I learned that the index is only maintained for published entities. This came up for a client who's using Admin Views for a much more flexible content administration interface. He couldn't see all posts that were unpublished and had certain tags — they just wouldn't show up even though the content was tagged with the terms of interest.

Maintaining the index for unpublished content would make the table (which can get quite large as it is) a little larger, so Drupal's community decided this was a performance optimization worth making. The recommended workaround is to use Taxonomy Entity Index, which creates a second table that indexes everything regardless of its published state. I'm a little surprised I hadn't seen this before, since people have been talking about it for years, but how else could you learn something new every day?

Categories: 
Tags: 
Comments are closed on this post to keep spammers at bay. If you want to chime in, please email or send a tweet.