Problem

Per documentation in metatag.migrate.inc I use the following lines to migrate metatag data:

$this->addFieldMapping('metatag_description', 'meta_description');
$this->addFieldMapping('metatag_abstract', 'meta_abstract');

The result in metatag table is following:

entity_type | entity_id | revision_id | language    | data
node        | 399       | 399         | abstract    | a:1:{s:5:"value";s:13:"meta abstract";}
node        | 399       | 399         | description | a:1:{s:5:"value";s:16:"meta description";}

As you can see, language value is missing. The metatag is also not showing in the source of the node.

If I save the node normally, I see the following entry in metatag table (with language prefix):

entity_type | entity_id | revision_id | language    | data
node        | 398       | 398         | und         | a:2:{s:11:"description";a:1:{s:5:"value";s:16:"meta description";}s:8:"abstract";a:1:{s:5:"value";s:13:"meta abstract";}}

Solution

Solution would be to include the entity language when migrating the metatag for the entity.

Comments

maijs’s picture

StatusFileSize
new673 bytes

The patch against 7.x-1.x is attached.

maijs’s picture

Issue summary: View changes
damienmckenna’s picture

Status: Active » Needs review

Thanks for finding that and going to the effort of putting together a patch, I appreciate it! I'll take a look at it soon.

PS, please don't forget to change the status to "Needs review" when you upload a patch, that'll tell me (and others) you have something to be reviewed.

damienmckenna’s picture

Status: Needs review » Fixed

Committed. Thanks!

Status: Fixed » Closed (fixed)

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