I'm having a big problem with this module on PHP 5.4.

in metatag.module at line 76 there is the code:

$hooks_entity_translation = array(
'entity_translation_insert',
'entity_translation_update',
'entity_translation_delete',
);
$hooks_entity_translation = array_fill_keys($hooks_entity_translation, array('group' => 'entity_translation'));

To add the above data to the 'hook_info' array generated in module_hook_info. The problem is that the entity translation module is also adding these hooks to the array meaning in hook info you see:

{entity_translation_insert :
{group :
0 : 'entity_translation',
1 : 'entity_translation'
}
}

Instead of being just:

{entity_translation_insert :
{group : 'entity_translation'}
}

Which it needs to be. The problem occurs later in module_implements() - includes/module.inc at line 709:

$include_file = isset($hook_info[$hook]['group']) && module_load_include('inc', $module, $module . '.' . $hook_info[$hook]['group']);

Because $hook_info[$hook]['group'] is now an array and not a string, it throws out a long list of errors:

Notice: Array to string conversion in module_implements() (line 709 of ~/includes/module.inc).

My question is, is the above code in metatag.module actually needed if it is being added by the entity_translation module? And if so, then there needs to be a way around this problem.

Adam

CommentFileSizeAuthor
#1 metatag-n1935084.patch979 bytesdamienmckenna

Comments

damienmckenna’s picture

Version: 7.x-1.0-beta4 » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new979 bytes

I think these were added without realizing what they were actually used for. This patch removes the entity_translation_* items entirely.

damienmckenna’s picture

Status: Needs review » Fixed

Committed.

adam clarey’s picture

Great, thanks.

I would have created the patch myself but just didn't know whether that code was needed for some other purpose.

damienmckenna’s picture

Status: Fixed » Closed (fixed)

Now that Metatag v7.x-1.0-beta5 is out am closing this to keep the issue queue clean.