After migrating from beta 7 dev version to beta 9, we are facing a lot of issues with Meta tag module. It appears that any change in global settings makes some custom meta tags disappear. For example, we remove keywords from a particular node at a global level and it made half of custom page title on the site disappear and fall back to global patterns but some of them still worked which is kind of strange.
We tried to go back to older version which was another nightmare, tried uninstalling and reinstalling the module which didn't work at all and eventually we had to restore the site from a few hours old database.
Meta tag was always a risky module but this new version seems very unstable. Has anyone else experienced issues and are there any workaround?
Thanks
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | Screen Shot 2015-12-22 at 11.42.40.png | 51 KB | marcelovani |
| #13 | metatag_by_path_consequences_fix-2184979-12.patch | 2.92 KB | skein |
Comments
Comment #1
damienmckennaWhat entity type are you seeing this problem with? Do you use revisions with your content? Do you use multiple languages, either via core, i18n or the Entity Translation modules? What display mechanism are you using with the entities that are experiencing problems - plain core templates, Panels, Views, Display Suite, etc? Have you checked the database to see if the records match up correctly?
Comment #2
Anonymous (not verified) commentedHappens to me with og. All custom node and user values defaults to global values most of the time and works fine sometimes.
My observation whenever i cache clear it defaults to global.
No revisions, no translation & core templates in my case.
Comment #3
standingtallYes, it works randomly and playing a havoc with SEO rankings as page titles keep changing.
We also experienced conflicts with token module.
No languages, we use custom templates.
Comment #4
damienmckennaAre you just using the default meta tags (admin/config/search/metatags) or are you also using meta tag defined via Context? Are you also using OG or anything else that might "attach" itself to the node pages?
Comment #5
standingtallWe are using Context (by path) meta tags but no OG or anything else.
Comment #6
standingtallCould this issue be related to this: https://drupal.org/node/2174363
Comment #7
standingtallThis weird issue continues. I have lost count of how many times I have updated custom meta tags and then they get overwritten in the field itself.
Comment #8
achtonI have just upgrade a site from beta8 to beta9 as well, and custom meta descriptions on nodes are not being rendered in the markup. Instead, the global or node level tokens are used.
The per-node data is present in the
metatagtable, but is not being used in the theme layer. I have not yet traced exactly what is going on.Comment #9
damienmckennaAre you using by-path (i.e. Metatag:Context) to control the entity-level tags or the global tags?
Is there anyone here having problems related to meta tag priority who is *not* using Metatag:Context?
Comment #10
damienmckennaComment #11
damienmckennaComment #12
damienmckennaDue to a lack of feedback I'm removing this from the 1.0-rc1 list.
Can everyone please confirm if the problem they are seeing is because the settings from admin/config/search/metatags are overriding the settings from admin/config/search/metatags/context?
Comment #13
skein commentedHi
I have bumped into this issue recently
The reason for the node specific titles disappearing is because the context module creates a global metatag key in the end of the array, which overrides the node specific keys.
I have mitigated the issue by placing the global key on top so the node can still inherit other tags that were not set.
I have attached a patch for the issue with modified tests as well.
Comment #14
skein commentedComment #15
marcelovaniI believe the context overriding the node's metatags is working as designed, the text that explains the behaviour of the module is here http://cgit.drupalcode.org/metatag/tree/metatag_context/metatag_context....
I was thinking to introduce a new setting to allow us to provide a priority/weight to metatag contexts, where we could specify that certain metatags will override nodes whereas some will be overriden by nodes, for example. I am currently working on a solution for that, based on what's been done here https://www.drupal.org/node/2497043
Comment #16
criscomSame problem here. Metatags context module installed, which was overwriting my per node settings.
skein's patch in #13 solved the problem. Thanks a lot mate, you saved my day!
Comment #17
marcelovaniMetatags by path are designed to override any other metatags i.e. nodes

Patch #13 is going to change the original behaviour, that could cause problems to people that do want the nodes to be overriden.
Comment #18
skein commentedI agree that this can cause issues in some cases, but it seems the priority should go by granularity.
So something like:
- Global
- Entity
- Entity type
- Path Rule (which is Context metatag)
- Entity Instance
Otherwise the issue https://www.drupal.org/node/2497043 should be the solution to that. But considering that issue is in Needs Review for 7 months now can we hope it will be eventually included in a stable release?
Comment #19
skein commentedAnother solution is to create a small contrib module that is dedicated to change the behaviour of path metatags
Comment #20
damienmckennaThe problem with changing the order in which the meta tags are loaded is that some sites might want them organized the way they currently are, so there would need to be some configuration behind it.
Once I finish v1.8 (and the huge i18n patch) I'll start looking into this functionality, but the items in the 1.8 list are my priority right now.
Also, this needs tests to confirm that the meta tags work the way expected.
Comment #21
marcelovaniI have been looking into issue 2497043 and I think it's a good idea to add weight. This way, users can decide if they want Context metatags to override everything or be overriden.
There is one problem tough, there are two ways of editing Context metatags:
The problem is that if we add the Weight option on form 1, it will not be visible on form 2 and vice-versa.
A similar problem exists on a configuration called 'Show on metatag admin page' (appears only on Context page (form 2).
To fix this, I was thinking to simplify the edition of Context metadata. When we visit form 1, the edit links would take us to the Context page (form 2). Once saved, redirect us back to the list (form 1).
By having that, we would have only one place to edit Context metatags, and there is where we would store the Weight information.
I think this should be fixed before we add the weight option.
Comment #22
marcelovaniUpdate: I have re-rolled the patch for issue 2497043
It works in the sense that you can order the context meta tags.
But it doesn't solve the problem of this issue.
We would need a new setting that would change the order of the array in metatag_context_page_build().
Comment #23
marcelovaniComment #24
rollingnet commentedMetatags by path don't override any other metatags at least in this case:
I overriden metatags in a view with page (ie: /store) display and I create a metatag setting by path for a specific parameter of that view's page (ie: /store/shoes).
View's metatags have priority over metatags by path, so it's not true the statement showed in admin/config/search/metatags/context:
Comment #25
marcelovaniHi rollingnet, you are right.
It used to work but eventually it got broken.
The fix is here https://www.drupal.org/node/2361343
Comment #26
rollingnet commentedI patched metatag_context/metatag_context.module only with https://www.drupal.org/files/issues/metatag_context_override-2361343-6.p... manually because it isn't applicable directly to the latest metatag dev release.
I can confirm that it fixes the override issue described in #24 (meta tags assigned by metatag path's submodule don't override other meta tags assigned elsewhere)
Comment #27
marcelovanirollingnet, I just re-rolled the patch in https://www.drupal.org/node/2361343
Do you want to test it again?
Thanks
Comment #28
rollingnet commentedJust patch against latest dev.
It works perfectly.
Comment #29
damienmckennaI've committed the patch in #2361343: Metatags in views override by path configuration, please let us know if there's anything else that should be changed. Thanks.
Comment #30
marcelovaniThanks Damien
I would like to suggest we address #21
We could create a new issue to add this new option.
Also, we need to write tests for it, which will also cover issue 2361343
Comment #31
damienmckennaNow that #2497043: Add weight to metatag_context has been added, are there other improvements you'd like to see added?
Comment #32
damienmckennaLets mark this one as being finished (thanks again marcelovani!), any other improvements can be handled as new issues.
Comment #34
Vincenzo commentedRight, not entirely easy to follow what happened here.
I can see the specific patch in here was never included in a release.
At the same time, now that I have switched from an old 1.7 to 1.17, the patch doesn't apply anymore; I went to look at the code in metatag_context, and I can see the function originally being patched here no longer exists. Shall I assume that this issue is actually fixed in 1.17?