After RC2 the isEmpty()
has been failing with array values.
For some reason however, this seem to be working with live installation with no problem whatsoever, but in (functional) tests, when loading page that tries to print out name field, it will give strlen-error, and the test fails there.
In both cases, the $this->values
in isEmpty()
contains following
array:7 [▼
"title" => null
"given" => "Ad"
"middle" => null
"family" => "Min"
"generational" => null
"credentials" => null
"_attributes" => []
]
and as you can see, we've _attributes
here (I'm not entirely sure whether it is supposed to be), that does not work properly with the code after
parent issue →
.
In tests, that empty array gives following error
1)
Drupal\Tests\my_module\Functional\MyModuleTest::testFoo
Exception: Warning: strlen() expects parameter 1 to be string, array given
Drupal\name\Plugin\Field\FieldType\NameItem->isEmpty()() (Line: 127)
Also to note, there was previously hidden bug similar to parent issue, that empty array that was not part of properties was falsely reported as not empty.