NodeTranslationMigrateSubscriber
class NodeTranslationMigrateSubscriber implements EventSubscriberInterface (View source)
Creates a key value collection for migrated node translation redirections.
If we are migrating node translations from Drupal 6 or 7, these nodes will be combined with their source node. Since there still might be references to the URLs of these now consolidated nodes, this service saves the mapping between the old nids to the new ones to be able to redirect them to the right node in the right language.
The mapping is stored in the "node_translation_redirect" key/value collection and the redirection is made by the NodeTranslationExceptionSubscriber class.
Properties
| protected KeyValueFactoryInterface | $keyValue | The key value factory. |
|
| protected StateInterface | $state | The state service. |
Methods
Constructs the NodeTranslationMigrateSubscriber.
Helper method to check if we are migrating translated nodes.
Maps the old nid to the new one in the key value collection.
Set the node_translation_redirect state to enable the redirections.
{@inheritdoc}
Details
__construct(KeyValueFactoryInterface $key_value, StateInterface $state)
Constructs the NodeTranslationMigrateSubscriber.
protected bool
isNodeTranslationsMigration(EventBase $event)
Helper method to check if we are migrating translated nodes.
onPostRowSave(MigratePostRowSaveEvent $event)
Maps the old nid to the new one in the key value collection.
onPostImport(MigrateImportEvent $event)
Set the node_translation_redirect state to enable the redirections.
static
getSubscribedEvents()
{@inheritdoc}