diff --git a/core/modules/path/src/Plugin/Field/FieldType/PathFieldItemList.php b/core/modules/path/src/Plugin/Field/FieldType/PathFieldItemList.php index 498636e..52db66b 100644 --- a/core/modules/path/src/Plugin/Field/FieldType/PathFieldItemList.php +++ b/core/modules/path/src/Plugin/Field/FieldType/PathFieldItemList.php @@ -53,6 +53,9 @@ public function isEmpty() { /** * Automatically create the first item for computed fields. * + * This ensures that ::getValue() and ::isEmpty() calls will behave like a + * non-computed field. + * * @todo: Move this to the base class in https://www.drupal.org/node/2392845. */ protected function ensureLoaded() { diff --git a/core/modules/path/src/Plugin/Field/FieldType/PathItem.php b/core/modules/path/src/Plugin/Field/FieldType/PathItem.php index 0446329..85b1caf 100644 --- a/core/modules/path/src/Plugin/Field/FieldType/PathItem.php +++ b/core/modules/path/src/Plugin/Field/FieldType/PathItem.php @@ -123,6 +123,12 @@ public static function mainPropertyName() { /** * Ensures the alias properties are loaded if available. + * + * This ensures that the properties will always be loaded and act like + * non-computed fields when calling ::__get() and getValue(). + * + * @todo: Determine if this should be moved to the base class in + * https://www.drupal.org/node/2392845. */ protected function ensureLoaded() { if (!$this->isLoaded) {