Skip to content
Snippets Groups Projects
Commit 367c98f4 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2761059 by govind.maloo, arunkumark, tstoeckler: Term::postDelete()...

Issue #2761059 by govind.maloo, arunkumark, tstoeckler: Term::postDelete() needlessly uses entity_delete_multiple()
parent 08e11c16
No related branches found
No related tags found
No related merge requests found
...@@ -68,7 +68,7 @@ public static function postDelete(EntityStorageInterface $storage, array $entiti ...@@ -68,7 +68,7 @@ public static function postDelete(EntityStorageInterface $storage, array $entiti
// If the term has multiple parents, we don't delete it. // If the term has multiple parents, we don't delete it.
$parents = $storage->loadParents($child->id()); $parents = $storage->loadParents($child->id());
if (empty($parents)) { if (empty($parents)) {
$orphans[] = $child->id(); $orphans[] = $child;
} }
} }
} }
...@@ -79,7 +79,7 @@ public static function postDelete(EntityStorageInterface $storage, array $entiti ...@@ -79,7 +79,7 @@ public static function postDelete(EntityStorageInterface $storage, array $entiti
$storage->deleteTermHierarchy(array_keys($entities)); $storage->deleteTermHierarchy(array_keys($entities));
if (!empty($orphans)) { if (!empty($orphans)) {
entity_delete_multiple('taxonomy_term', $orphans); $storage->delete($orphans);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment