summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author7thkey2016-05-20 15:18:13 (GMT)
committerMaciej Zgadzaj2016-05-20 15:18:13 (GMT)
commitc293e69ec9d4c1eabef387d25d1f0b6eaed58c4f (patch)
tree7629533bdeb36e5df359398d9d9d6a9581c04015
parent5519dfde89009d79e05e2979d043ca54dc6be269 (diff)
Issue #2634978 by 7thkey: While deleting, ensure the entity has an URI
-rw-r--r--pathauto_entity.module6
1 files changed, 5 insertions, 1 deletions
diff --git a/pathauto_entity.module b/pathauto_entity.module
index 0167c64..f624ea7 100644
--- a/pathauto_entity.module
+++ b/pathauto_entity.module
@@ -286,7 +286,11 @@ function pathauto_entity_entity_update($entity, $entity_type) {
* Implements hook_entity_delete().
*/
function pathauto_entity_entity_delete($entity, $entity_type) {
- pathauto_entity_path_delete_all($entity_type, $entity);
+ // Ensure that all entities have an uri.
+ $uri = entity_uri($entity_type, $entity);
+ if (isset($uri['path'])) {
+ pathauto_entity_path_delete_all($entity_type, $entity);
+ }
}
/**