Latest (7.x-1.0-beta9) version of module supposed to work with revisions. And it works. But not with revisions and panels.
It is not working due to entity is loading(with current revision) instead of popualting from context.
I've created patch to fix this.

Comments

f5.andrii’s picture

StatusFileSize
new1.06 KB

Minor fix added.

botris’s picture

I confirm this bug.
But in order to make metatags work in panels and multiligual I had to change this:

metatag_entity_view($first_context->data, $entity_name, 'full', $first_context->data->language, TRUE);
damienmckenna’s picture

damienmckenna’s picture

Status: Needs review » Needs work

This needs to be rerolled.

damienmckenna’s picture

Version: 7.x-1.0-beta9 » 7.x-1.x-dev
Status: Needs work » Needs review
StatusFileSize
new1.24 KB

This should do it.

b-prod’s picture

Status: Needs review » Needs work

@DamienMcKenna: actually I do not understand where you get the "$entity_name" variable in your patch.

I think you could rely on the $context->type array, which values may contain useful information: you can ensure you are dealing with entities.

$first_context = array_pop($context['contexts']);

if (isset($first_context->type) && is_array($first_context->type) && !empty($first_context->data)) {
  list(, $data_type, $entity_type) = $first_context->type;

  if ($data_type === 'entity') {
    $langcode = entity_language($entity_type, $first_context->data);
    metatag_entity_view($first_context->data, $entity_type, 'full', $langcode, TRUE);
  }
}

Note that this does not take care of the old CTools context handlers but only the new "entity" one.

Moreover, we also could perform a loop against the $contexts variable until we have an entity... Not sure it would be a expected behaviour though.

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new2.1 KB

I updated that function to use the norma $entity_type variable for the entity type's name, and $entity_info for the entity type's info.

damienmckenna’s picture

StatusFileSize
new1.24 KB

Rerolled.

damienmckenna’s picture

Status: Needs review » Fixed

Committed.

  • DamienMcKenna committed cf9560d on 7.x-1.x
    Issue #2186241 by nnevill.io1, DamienMcKenna: Revisions support for...

Status: Fixed » Closed (fixed)

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