When we update the metatag of a node in drupal, It does not provide the revision history in the node revision tab.

Comments

kkumarz created an issue. See original summary.

Kuldeep K’s picture

Title: Updation of metatag does not showing in node revisions. » Updation of metatag does not showing in node revisions. Diff integration with metatags.
Status: Active » Fixed
Issue tags: +Diff integration

Issue resolved I used this hook.

function MODULE_NAME_entity_diff($old_entity, $new_entity, $context) {
  $entity_type = $context['entity_type'];
  if ($context['entity_type'] == 'node') {
    if (metatag_entity_supports_metatags($entity_type)) {
      $language = metatag_entity_get_language($entity_type, $new_entity);
      $init_weight = 100;
      foreach($new_entity->metatags['und'] as $key => $keyword) {
        $id = ucwords('Meta '.$key);
        $result[$id] = array(
          '#name' => $id,
          '#old' => array($old_entity->metatags['und'][$key]['value']),
          '#new' => array($new_entity->metatags['und'][$key]['value']),
          '#weight' => $init_weight++,
          '#settings' => array(
            'show_header' => TRUE,
          ),
        );
      }
    }
  }
  return $result;
}

Status: Fixed » Closed (fixed)

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