- π¬π§United Kingdom catch
Took me a few minutes to figure out where the equivalent code is, it's here:
/** * {@inheritdoc} */ public function postSave(EntityStorageInterface $storage, $update = TRUE) { parent::postSave($storage, $update); $alias_manager = \Drupal::service('path_alias.manager'); $alias_manager->cacheClear($this->getPath()); if ($update) { $alias_manager->cacheClear($this->original->getPath()); } } /** * {@inheritdoc} */ public static function postDelete(EntityStorageInterface $storage, array $entities) { parent::postDelete($storage, $entities); $alias_manager = \Drupal::service('path_alias.manager'); foreach ($entities as $entity) { $alias_manager->cacheClear($entity->getPath()); } }
However PathAlias::clearCache() will always get a source $path from $entity->getPath() and no longer tries to load path aliases, so I think this is outdated and marking as such.