As soon as the metatags module is activated, the 'metatags' property is added to every entity in hook metatag_entity_load().
In Drupal 7 entities are also used for configurations, e.g. taxonomy vocabularies or Entity API configs like Profile2. On such entities the metatags property does not make any sense. Furthermore it makes many features overridden, if you activate the metatags module once the features have already been exported.

Attached patch adds a check in metatag_entity_load() on whether the current entity type supports metatags. Additionally this patch avoids unnecessary metatag_metatags_load_multiple() calls when the entity type can not have metatags anyway.

#1 1841404-metatag_entity_load_check-1.patch1.54 KBmh86
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es). View
metatag_entity_load_check.patch764 bytesmh86
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es). View
Members fund testing for the Drupal project. Drupal Association Learn more


mh86’s picture

1.54 KB
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es). View

Small follow-up, we should also check that $entity_type['configuration'] is not set or FALSE (this is an Entity API setting). Otherwise the metatag property will still be exported for entities like message types or rules link configurations.

DamienMcKenna’s picture

Title: Do not export metatags property on configuration entities » Do not load Metatag properties on configuration entities
Status: Needs review » Fixed

(updated the title)
Good catch, committed!

DamienMcKenna’s picture

Status: Fixed » Closed (fixed)

Version 7.x-1.0-beta3 has been released and includes this work. Am closing this issue in an effort to keep the issue queue clean. Thank you all for your continued help!