diff --git a/core/modules/path/src/Plugin/Field/FieldType/PathFieldItemList.php b/core/modules/path/src/Plugin/Field/FieldType/PathFieldItemList.php index 52db66b6fc..a98e718696 100644 --- a/core/modules/path/src/Plugin/Field/FieldType/PathFieldItemList.php +++ b/core/modules/path/src/Plugin/Field/FieldType/PathFieldItemList.php @@ -51,6 +51,14 @@ public function isEmpty() { } /** + * {@inheritdoc} + */ + public function getIterator() { + $this->ensureLoaded(); + return parent::getIterator(); + } + + /** * Automatically create the first item for computed fields. * * This ensures that ::getValue() and ::isEmpty() calls will behave like a diff --git a/core/modules/path/src/Plugin/Field/FieldType/PathItem.php b/core/modules/path/src/Plugin/Field/FieldType/PathItem.php index 4cbc8f244f..53ddcc2689 100644 --- a/core/modules/path/src/Plugin/Field/FieldType/PathItem.php +++ b/core/modules/path/src/Plugin/Field/FieldType/PathItem.php @@ -76,6 +76,14 @@ public function isEmpty() { /** * {@inheritdoc} */ + public function getIterator() { + $this->ensureLoaded(); + return parent::getIterator(); + } + + /** + * {@inheritdoc} + */ public function preSave() { $this->alias = trim($this->alias); }