Problem/Motivation
In FieldValueSourceBase::extractPropertyValue(), we have this:
$value = $property->getValue();
$value = empty($value) ? '' : $value;
So, false boolean are casted as "". 0 numeric are casted as "".
It seems it may make a mess with boolean field properties.
Proposed resolution
What was the purpose of this line? Do we still need it?
Maybe it was to filter out empty arrays of objects, so we need a way to prevent it to alter scalars.
Issue fork ui_patterns-3475163
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
pdureau commentedComment #3
pdureau commentedComment #6
just_like_good_vibesplease review
Comment #7
pdureau commentedUrl::fromUri($value, $options) only accepts strings for
$valueBecause we are testing
($property instanceof Uri)before, we know than $value will be an URL if not NULL, so your code is OK.However, I am afraid it will not be clear enough for the next guy which will read this code in the future.
So, I have moved the logic to a proper, more explicit, method. If you are OK, you can merge.
Comment #8
just_like_good_vibesok for me, but the name resolvesUri is not so explicit, is it?
Comment #9
pdureau commentedIndeed, i will use
resolvesInernalUribecause this is what we want to do: get public URI from internal URIComment #10
pdureau commentedComment #12
just_like_good_vibesComment #13
pdureau commented