Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
We encounter a very critical issue about Metatag (and Revision) on our production website. Let me explain how to reproduce it:
- We create a node with a specific metatag such as 'description'
- We save it and publish it -> it creates a base revision
- We create another revision with some modifications but we didn't publish it
- The metatags are present in the unpublished revision but we lost them in the current publish version
Have you heard about this issue?
Technical information:
- Revisioning: 7.x-1.6
- Metatag: 7.x-1.0-beta9
Thanks in advance.
Comment | File | Size | Author |
---|---|---|---|
#5 | 2237507-5-metatag_revision_condition.patch | 451 bytes | SebCorbin |
Comments
Comment #1
standingtall CreditAttribution: standingtall commentedThis is same as this https://drupal.org/node/2184979
Current version of meta tag is full of bugs.
Comment #2
blazingarrow CreditAttribution: blazingarrow commentedSee https://drupal.org/comment/8371977#comment-8371977 for the solution. It's quite simple, just disable Global: Front page settings, in admin/config/search/metatags and the settings from node will be used.
Comment #3
madchris CreditAttribution: madchris commentedHi,
I think I've found something.
In the metatag.module file, the metatag_metatags_save() function makes a db_delete('metatag') but without a "revision_id" condition. So if you are working with revisions, and if your metatags datas are empty, you will lose all your metatags datas for the node and all its revisions.
Wouldn't it be better to add the line "->condition('revision_id', $revision_id)" to the query, if $revision_id !=0 ?
Comment #4
camille.maniez CreditAttribution: camille.maniez commentedComment #5
SebCorbin CreditAttribution: SebCorbin commentedComment #3 has it.
Bumping to critical priority as it deletes data. Patch attached.
Comment #6
SebCorbin CreditAttribution: SebCorbin commentedComment #7
Maxime Gilbert CreditAttribution: Maxime Gilbert commentedThis works like a charm: must be released.
Comment #8
gregglesSlightly better title. I agree this looks like a pretty bad bug.
Any comment from the maintainers on this patch?
Comment #10
DamienMcKennaCommitted. Sorry for letting that slip in :(