From 367c98f45c3fd1718d1605a600f6ed367a03862c Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Fri, 21 Oct 2016 06:28:02 -0700
Subject: [PATCH] Issue #2761059 by govind.maloo, arunkumark, tstoeckler:
 Term::postDelete() needlessly uses entity_delete_multiple()

---
 core/modules/taxonomy/src/Entity/Term.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/modules/taxonomy/src/Entity/Term.php b/core/modules/taxonomy/src/Entity/Term.php
index 2e41e2d0f016..c8ef06e5a48b 100644
--- a/core/modules/taxonomy/src/Entity/Term.php
+++ b/core/modules/taxonomy/src/Entity/Term.php
@@ -68,7 +68,7 @@ public static function postDelete(EntityStorageInterface $storage, array $entiti
           // If the term has multiple parents, we don't delete it.
           $parents = $storage->loadParents($child->id());
           if (empty($parents)) {
-            $orphans[] = $child->id();
+            $orphans[] = $child;
           }
         }
       }
@@ -79,7 +79,7 @@ public static function postDelete(EntityStorageInterface $storage, array $entiti
     $storage->deleteTermHierarchy(array_keys($entities));
 
     if (!empty($orphans)) {
-      entity_delete_multiple('taxonomy_term', $orphans);
+      $storage->delete($orphans);
     }
   }
 
-- 
GitLab