diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Term.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Term.php index daeb3ac..52c4035 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Term.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Term.php @@ -155,9 +155,7 @@ public static function postDelete(EntityStorageControllerInterface $storage_cont foreach ($children as $child) { // If the term has multiple parents, we don't delete it. $parents = taxonomy_term_load_parents($child->id()); - // Because the parent has already been deleted, the parent count might - // be 0. - if (count($parents) <= 1) { + if (empty($parents)) { $orphans[] = $child->id(); } }