Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295716

FieldItemBase::getValue() returns partial or full values depending on state

$
0
0

Problem/Motivation

Depending on the state of the field, and which methods have been called, the return value of getValue() will be different.

Scenario

$field = User::load(1)->get('pass');
$value1 = $field->getValue();
$field->getProperties();
$value2 = $field->getValue();

Expected

$value1 === $value2

Actual

$value1 !== $value2

Proposed resolution

Switch from looping over $this->properties to $this->getProperties()

Remaining tasks

User interface changes

API changes

Data model changes

\Drupal\Core\TypedData\Plugin\DataType\Map::getValue()


Viewing all articles
Browse latest Browse all 295716

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>