I updated to metatag beta9, some days ago. Today i wanted to change a metatag and saw...well ALL METATAGS ARE DELETED IN EVERY NODE.
What the hell. This is seriously dangerous. So i suggested some warning. This may happen to you too.
Update note:
Removed 2 meta tag record(s) for the taxonomy_vocabulary entity type, it does not support meta tags.
Removed 1 meta tag record(s) for the rules_config entity type, it does not support meta tags.
Removed 5 meta tag record(s) for nodes that had been purged.
Removed 26 meta tag record(s) for taxonomy terms that had been purged.
Jea it removed 5 metatag records from my five nodes. These nodes have not been purged but somehow the update thought so.
Comments
Comment #1
marcoka commentedOk. I cleared the cache.
This is the Metatag field inside the node is empty.
But inside the code i get
so somehow the meta tags get still generated correctly but not displayed in the field. default is not used, its the text i typed in manually.
edit: its seems that this happened only on some nodes. no real pattern detectable. all nodes are of the same type.
Comment #2
marcoka commentedi am open for debug suggestions. i have phpstorm and xdebug running.
Comment #3
marcoka commentedi checked my database
http://i.imgur.com/6bdmBhN.png
the data is still here but somehow default settings are used in every single node
http://i.imgur.com/EWSWXZ0.png
edit, checked the BLOB, converted it: http://i.imgur.com/4k40Sd6.png
so data is still there but not loaded in the node.
version i used before update: 7.x-1.0-beta4
Comment #4
damienmckennaComment #5
damienmckennaThere are several pieces to this puzzle.
First off, the "Removed @count meta tag record(s) for nodes that had been purged" part only happens if there are nodes that had been deleted and had left {metatag} records behind, it won't (or at least *should* not, and I've tested it quite a bit) delete {metatag} records if the node exists.
Secondly, it seems like there may be something causing the node meta tags to not load correctly. Can you please show me a full dump of the {metatag} records for one of the nodes, and then compare the 'language', and 'vid' values in the {node} table and let me know if they match? Also, what is your site's default language?
I've reduced the priority of this to 'normal' and updated some other options to be more accurate against the remaining problem.
Comment #6
lnicks commentedI am having the same issue with beta9.
We attempted to migrate from nodewords on d6 to metatag on d7, using the nodewords_migrate module located here: https://drupal.org/node/1434756#comment-7863375
However this threw errors, so following the instructions here:
https://drupal.org/comment/6914602#comment-6914602
we were able to finish the migration.
The records imported the meta data correctly, but revision_id and language columns were empty. Manually assigning the records the matching vid from the {node} table and setting the language to en causes the data to appear in the edit form.
My guess is that the migration didn't move that data over and that is a separate issue, which I'm guessing is related to the columns just not existing in that version of metatag? I just wanted to write and confirm that changing the revision_id and lang to match what is in the node table results in the node edit form being populated correctly.
Comment #7
marcoka commentedSite is:
- default language: german (default) and english activated (not default)
I updated to 9 beta.
I am using my node 219 as test node. before the update metatags showed up in the edit form. Now they dont.
metatag table: http://i.imgur.com/KpmhOZi.png
node table: http://i.imgur.com/b3KeVDK.png
tell me if you need more data.
Comment #8
marcoka commentedis the last update working for people that just use english? i cant find the problem. maybe i am the only on or it will be a problem for every user that switches the language from standard english to X.
Comment #9
marcoka commenteddebugded around ok found out that the $entity object is missing the metattags data. if i then add new tags and save it will be there next time i debug
found some more confusing stuff. i guess rid here is revision if which is 133 whoch is wrong the node id is 249.http://i.imgur.com/nHewyvJ.png
1.) Node with redirect
Here we go i found the problem. If we have a node with a redirect (redirect module) it will not load the metatags using function metatag_entity_load. if i kill the redirect and clear all caches/and manually the entity cache tables. the mettags will appear.
2.) Node with nod redirect used
Run update, drush cc all. Visit/edit the node, no meta tags. Go into the database manually and kill all enity cache tables again. Edit the node, meta tags appear.
I tried 2.) with a node with a redirect that works too.
So i can edit a node clear all cache tables and then that node works. problem is i would have to do exactly this for every single node.
Comment #10
Road Kill commentedSame problem here after updating from 7.x-1.0-beta4 to 7.x-1.0-beta9 and also tried the dev but no joy.
The Meta tag info is still stored database side even though the fields still display the default as Marcoka said #3, but I have also noticed that if you edit a node and save the default setting then do overwrite the original description and page title which is very worrying.
Some people are also reporting that this is an entity cache problem but I do not have entity cache installed.
I have reverted back to 7.x-1.0-beta4 and will setup test site to test before upgrading again.
Well done to the developers for bringing in the views and panel functionality great job.
Comment #11
Romlam commentedHi,
I've found the problem : a typo in variable name...
See the patch in attachment.
Comment #12
lex0r commented@Romlam, you are awesome!
@ALL: please, use IDEs that underline unused variables :)
Comment #13
gregglesBetter status since there is a patch. The change looks reasonable to me.
Comment #15
gregglesRerolled. Same change as #11, but created with a git clone - hopefully this will apply.
Comment #16
damienmckennaThanks for the fix! Committed!
Comment #18
marcoka commentedthank you! :)
Comment #20
Romlam commentedYou are welcome !