NodeTranslationExceptionSubscriber
class NodeTranslationExceptionSubscriber implements EventSubscriberInterface (View source)
Redirect node translations that have been consolidated by migration.
If we migrated node translations from Drupal 6 or 7, these nodes are now combined with their source language node. Since there still might be references to the URLs of these now consolidated nodes, this service catches the 404s and try to redirect them to the right node in the right language.
The mapping of the old nids to the new ones is made by the NodeTranslationMigrateSubscriber class during the migration and is stored in the "node_translation_redirect" key/value collection.
Properties
| protected KeyValueFactoryInterface | $keyValue | The key value factory. |
|
| protected LanguageManagerInterface | $languageManager | The language manager. |
|
| protected UrlGeneratorInterface | $urlGenerator | The URL generator. |
|
| protected StateInterface | $state | The state service. |
Methods
Constructs the NodeTranslationExceptionSubscriber.
Redirects not found node translations using the key value collection.
{@inheritdoc}
Details
__construct(KeyValueFactoryInterface $key_value, LanguageManagerInterface $language_manager, UrlGeneratorInterface $url_generator, StateInterface $state)
Constructs the NodeTranslationExceptionSubscriber.
onException(ExceptionEvent $event)
Redirects not found node translations using the key value collection.
static array
getSubscribedEvents()
{@inheritdoc}