Skip to content
Snippets Groups Projects

Issue #3357928: deleteEntityPathAll calls getInternalPath on potentially unrouted url

1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
+ 1
1
@@ -100,7 +100,7 @@ function pathauto_entity_update(EntityInterface $entity) {
* Implements hook_entity_delete().
*/
function pathauto_entity_delete(EntityInterface $entity) {
if ($entity->hasLinkTemplate('canonical') && $entity instanceof ContentEntityInterface && $entity->hasField('path') && $entity->getFieldDefinition('path')->getType() == 'path') {
if ($entity->hasLinkTemplate('canonical') && $entity instanceof ContentEntityInterface && $entity->hasField('path') && $entity->getFieldDefinition('path')->getType() == 'path' && $entity->toUrl('canonical')->isRouted()) {
\Drupal::service('pathauto.alias_storage_helper')->deleteEntityPathAll($entity);
$entity->get('path')->first()->get('pathauto')->purge();
}
Loading