Problem

There are two typos in metatag_metatags_cache_clear() method which cause whole Metatag cache bin to clear when a change is made in a single entity.

Steps to Reproduce

Edit any node, change Metatags, save.

Expected Result

It should clear just the cache regarding the edited node.

Experienced Result

It clears the whole node cache from Metatag cache bin.

Proposed resolution

Change metatag.module line 587 from

if (empty($entity_id)) {

to

if (empty($entity_ids)) {

and change metatag.module line 591 from

if (!array($entity_ids)) {

to

if (!is_array($entity_ids)) {

Remaining tasks

The attached patch needs to be tested and included in the module.

Comments

adee147’s picture

Issue summary: View changes
damienmckenna’s picture

Version: 7.x-1.0-beta9 » 7.x-1.x-dev
Status: Patch (to be ported) » Needs review

FYI when you upload a patch you should change the status to "needs review", that way the system will trigger the automated test.

damienmckenna’s picture

damienmckenna’s picture

StatusFileSize
new630 bytes

Corrected the patch so it can apply properly.

The last submitted patch, 0001-Metatag-PHP-syntax-bugs-fixed-regarding-metatag_meta.patch, failed testing.

damienmckenna’s picture

Status: Needs review » Fixed

Committed. Thanks adee147!

  • Commit 6096b68 on 7.x-1.x authored by adee147, committed by DamienMcKenna:
    Issue #2271685 by adee147: Typos in metatag_metatags_cache_clear().
    

Status: Fixed » Closed (fixed)

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