Commit 7226aeb8 authored by Rich Gerdes's avatar Rich Gerdes Committed by Damien McKenna
Browse files

Issue #3171660 by richgerdes, DamienMcKenna: Migration Plugin Alter breaks...

Issue #3171660 by richgerdes, DamienMcKenna: Migration Plugin Alter breaks with commerce_migrate_commerce.
parent 7644dc0a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -7,6 +7,8 @@ Metatag 8.x-1.x-dev, xxxx-xx-xx
#3180470 by SivaprasadC: Typos in couple of files.
#3169952 by Wim Leers, tim.plunkett: Derive metatag migrations by entity type
  (and bundle).
#3171660 by richgerdes, DamienMcKenna: Migration Plugin Alter breaks with
  commerce_migrate_commerce.


Metatag 8.x-1.14, 2020-08-11
+12 −5
Original line number Diff line number Diff line
@@ -927,13 +927,20 @@ function _metatag_is_migration_plugin_supported(array $definition) {
    }
  }

  // Only support content entity destinations.
  // Only support content entity destinations. Protect against situations where
  // the plugins haven't loaded yet, e.g. when using Commerce Migrate.
  try {
    $plugin_definition = \Drupal::service('plugin.manager.migrate.destination')
      ->getDefinition($definition['destination']['plugin']);
    $destination_plugin = DefaultFactory::getPluginClass($definition['destination']['plugin'], $plugin_definition);
    if (!is_subclass_of($destination_plugin, EntityContentBase::class) && $destination_plugin !== EntityContentBase::class) {
      return FALSE;
    }
  }
  catch (\Drupal\Component\Plugin\Exception\PluginNotFoundException $e) {
    // If the entity type doesn't exist, neither with the migration plugin.
    return FALSE;
  }

  // If this stage is reached then this is a supported core migration and the
  // Metatag migration will be automatically handled.