In the d8cache_do_invalidate_cache_tags function, the $tags variable gets passed in as tags to be cleared keyed by a boolean TRUE.

Further down, it appears as though the code assume the opposite is true, where the values in the array are expected to be the cache tags to be cleared. This causes issues as the call to array_unique clears away all the tags to be cleared except the first since it's only allowing filtering all but one TRUE value.

It looks like if we grab the keys of the array and pass that along to array_unique and sort, we'll get the expected behavior where the tag names are being cleared instead of a single array(0 => TRUE).

Patch to follow.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kengilb created an issue. See original summary.

kengilb’s picture

kengilb’s picture

New patch to move convert the array in place that makes more sense.

kengilb’s picture

One more patch omitting the unnecessary search value.

kengilb’s picture

  • kengilb authored eae5211 on 7.x-1.x
    Issue #3027001 by kengilb: Cache Tags Not Clearing as Expected
    
bdragon’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
Status: Needs review » Fixed

Committed, thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.