diff --git a/core/lib/Drupal/Core/TypedData/Plugin/DataType/ItemList.php b/core/lib/Drupal/Core/TypedData/Plugin/DataType/ItemList.php index 2c7e3ed..f5b44c3 100644 --- a/core/lib/Drupal/Core/TypedData/Plugin/DataType/ItemList.php +++ b/core/lib/Drupal/Core/TypedData/Plugin/DataType/ItemList.php @@ -112,9 +112,8 @@ public function get($index) { if (!is_numeric($index)) { throw new \InvalidArgumentException('Unable to get a value with a non-numeric delta in a list.'); } - // Automatically create the first item for "computed lists". -// @todo what would be an example of "getItemDefinition()->isComputed()" ? - if ($index == 0 && !isset($this->list[0]) && ($this->definition->isComputed() || $this->definition->getItemDefinition()->isComputed())) { + // Automatically create the first item for computed fields. + if ($index == 0 && !isset($this->list[0]) && ($this->definition->isComputed())) { $this->list[0] = $this->createItem(0); } return isset($this->list[$index]) ? $this->list[$index] : NULL; diff --git a/core/modules/comment/src/Plugin/Field/FieldType/CommentItem.php b/core/modules/comment/src/Plugin/Field/FieldType/CommentItem.php index 90811cc..4ec3ecd 100644 --- a/core/modules/comment/src/Plugin/Field/FieldType/CommentItem.php +++ b/core/modules/comment/src/Plugin/Field/FieldType/CommentItem.php @@ -163,20 +163,6 @@ public function fieldSettingsForm(array $form, FormStateInterface $form_state) { /** * {@inheritdoc} */ - public function __get($name) { - if ($name == 'status' && !isset($this->values[$name])) { - // Get default value from the field when no data saved in entity. - $field_default_values = $this->getFieldDefinition()->getDefaultValue($this->getEntity()); - return $field_default_values[0]['status']; - } - else { - return parent::__get($name); - } - } - - /** - * {@inheritdoc} - */ public function isEmpty() { // There is always a value for this field, it is one of // CommentItemInterface::OPEN, CommentItemInterface::CLOSED or