diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php index 0401b7bdec..90bb702379 100644 --- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php +++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php @@ -639,11 +639,4 @@ public function save() { return $return; } - /** - * {@inheritdoc} - */ - public function getIterator() { - return $this->getTypedData()->getIterator(); - } - } diff --git a/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php b/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php index a7f62e79fe..8577f25c98 100644 --- a/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php +++ b/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php @@ -166,11 +166,11 @@ public function applyDefaultValue($notify = TRUE) { */ public function getIterator() { if (isset($this->entity)) { - if ($this->entity instanceof FieldableEntityInterface) { - $this->entity->getIterator(); + if ($this->entity instanceof ConfigEntityInterface) { + return $this->getConfigTypedData()->getIterator(); } else { - $this->getConfigTypedData()->getIterator(); + return $this->entity->getIterator(); } } return new \ArrayIterator([]);