- π·πΊRussia batkor Irkutsk
Hi.
Create patch for beta3 tags.
Implements from event dispatcher.I think need move patch for a 2 branch
- π·πΊRussia batkor Irkutsk
Example for $11
/** * Implements pre save event subscriber. * * @param \Drupal\default_content_deploy\Event\PreSaveEntityEvent $event * The event. */ public function preSave(PreSaveEntityEvent $event) { $pathAliasesStorage = $this ->entityTypeManager ->getStorage('path_alias'); $data = $event->getData(); $entity = $event->getEntity(); if (empty($data['path'])) { return; } foreach (array_keys($entity->getTranslationLanguages()) as $langcode) { $value = NULL; foreach ($data['path'] as $pathValue) { if ($pathValue['langcode'] === $langcode) { $value = $pathValue; break; } } if (!empty($value) && !empty($value['alias'])) { unset($value['pid']); $value['pathauto'] = PathautoState::SKIP; $pathAliases = $pathAliasesStorage->loadByProperties([ 'alias' => $value['alias'], ]); $pathAliasesStorage->delete($pathAliases); $translateEntity = $entity->getTranslation($langcode); $translateEntity->set('path', $value); $this->pathautoGenerator->createEntityAlias($translateEntity, 'insert'); } } }
- πΊπ¦Ukraine Mykhailo.Levchenko
Hi all,
Is there any info on when this patch will be applied?
Thank you,
Misha - First commit to issue fork.
-
mkalkbrenner β
committed 993e9838 on 2.0.x authored by
batkor β
Issue #3282937 by batkor, michaellenahan, mkalkbrenner: Add support path...
-
mkalkbrenner β
committed 993e9838 on 2.0.x authored by
batkor β
-
mkalkbrenner β
committed 7e7c96f7 on 2.0.x authored by
batkor β
Issue #3282937 by batkor, michaellenahan, mkalkbrenner: Add support path...
-
mkalkbrenner β
committed 7e7c96f7 on 2.0.x authored by
batkor β
- π©πͺGermany mkalkbrenner π©πͺ
The event is committed.
We could solve this feature request now be adding a small default_content_deploy_pathauto sub-module to this repository.
There we could declare all required dependencies and implement the event subscriber.BTW That's the pattern we use in the Search API eco-system.
- π©πͺGermany mkalkbrenner π©πͺ
Meanwhile, the situation changed drastically. Paths are computed fields and don't belong to a node or an other entity directly.
The recommended way is to export the path alias entity itself.Nevertheless we should handle pathauto. We should add a configuration option if a alias should be generated or not during import.
The default should be to turn it off.