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

Comments

damienmckenna’s picture

What 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?

Anonymous’s picture

Happens 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.

standingtall’s picture

Yes, 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.

damienmckenna’s picture

Are 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?

standingtall’s picture

We are using Context (by path) meta tags but no OG or anything else.

standingtall’s picture

Could this issue be related to this: https://drupal.org/node/2174363

standingtall’s picture

This 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.

achton’s picture

I 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 metatag table, but is not being used in the theme layer. I have not yet traced exactly what is going on.

damienmckenna’s picture

Title: A global metatag change breaks the custom meta tags » Context:Metatag (by path) unintended consequences
Version: 7.x-1.0-beta9 » 7.x-1.x-dev
Component: Code » Context integration

Are 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?

damienmckenna’s picture

Priority: Major » Normal
damienmckenna’s picture

damienmckenna’s picture

Status: Active » Postponed (maintainer needs more info)
Parent issue: #2175021: META: Plan for Metatag 7.x-1.0-rc1 release »

Due 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?

skein’s picture

Status: Postponed (maintainer needs more info) » Active
StatusFileSize
new2.92 KB

Hi

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.

skein’s picture

Status: Active » Needs review
marcelovani’s picture

I 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....

  $caption = t('Values assigned here inherit from the <a href="@url" title="Edit the global default meta tags.">global defaults</a> and will override any other meta tags assigned elsewhere.', array('@url' => url('admin/config/search/metatags/config/global')));

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

criscom’s picture

Same 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!

marcelovani’s picture

Issue summary: View changes
StatusFileSize
new51 KB

Metatags 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.
By design, metatags by path override any other metatags

skein’s picture

I 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?

skein’s picture

Another solution is to create a small contrib module that is dedicated to change the behaviour of path metatags

damienmckenna’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

The 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.

marcelovani’s picture

I 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:

  1. Via admin/config/search/metatags/context
  2. Via admin/structure/context

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.

marcelovani’s picture

Update: 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().

marcelovani’s picture

Issue summary: View changes
rollingnet’s picture

Metatags 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:

Values assigned here inherit from the global defaults and will override any other meta tags assigned elsewhere.

marcelovani’s picture

Hi rollingnet, you are right.

It used to work but eventually it got broken.

The fix is here https://www.drupal.org/node/2361343

rollingnet’s picture

I 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)

marcelovani’s picture

rollingnet, I just re-rolled the patch in https://www.drupal.org/node/2361343
Do you want to test it again?
Thanks

rollingnet’s picture

Just patch against latest dev.
It works perfectly.

damienmckenna’s picture

I'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.

marcelovani’s picture

Thanks 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

damienmckenna’s picture

Now that #2497043: Add weight to metatag_context has been added, are there other improvements you'd like to see added?

damienmckenna’s picture

Status: Needs work » Fixed

Lets mark this one as being finished (thanks again marcelovani!), any other improvements can be handled as new issues.

Status: Fixed » Closed (fixed)

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

Vincenzo’s picture

Right, 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?