Commit 22364a3f authored by shubham.prakash's avatar shubham.prakash Committed by Berdir
Browse files

Issue #3006420 by StryKaizer, drunken monkey, shubham.prakash:...

Issue #3006420 by StryKaizer, drunken monkey, shubham.prakash: pathauto_entity_delete() should not assume "path" property belongs to this module
parent 78c96fca
......@@ -97,7 +97,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')) {
if ($entity->hasLinkTemplate('canonical') && $entity instanceof ContentEntityInterface && $entity->hasField('path') && $entity->getFieldDefinition('path')->getType() == 'path') {
\Drupal::service('pathauto.alias_storage_helper')->deleteEntityPathAll($entity);
$entity->get('path')->first()->get('pathauto')->purge();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment