- Issue created by @hctom
- 🇩🇪Germany hctom
Update to issue summary to name the right
typed_data
values for number fields (becausenumber
is not correct there / not available as typed data type) - 🇩🇪Germany hctom
Removed
decimal
from list oftyped_data
values to add, because there is notList (decimal)
field type in Drupal. - Merge request !272#3488879 Define typed_data support in enum-related PropType plugin definitions → (Open) created by hctom
- 🇩🇪Germany hctom
So, finally got the time to create my first draft for this:
- Added the
typed_data
values to theenum*
PropType plugins - Added some logic to ensure field source value is a valid enum option - if not, it will fall back to a valid value in that order:
- property default value (if defined)
- first enum option value (if property is required)
NULL
(if property is optional)
Looking forward to your review ;)
- Added the
- 🇫🇷France pdureau Paris
Hi Tom,
Tested with enum, it works well, thanks a lot
However, you did the change also for
enum_set
andenum_list
and I am struggling to see the use cases this is covering:
What is the best way of testing integration withenum_set
andenum_list
? - 🇫🇷France pdureau Paris
Following our Slack discussion, I believe we need to focus on
enum
prop type and create a follow-up issue for others.Is it the opportunity to simplify the logic in EntityFieldSource::getPropValue() ?
Do you know about EnumTrait::convertValueToEnumType() ? it may be useful to send string values to numerical enums.
- 🇩🇪Germany hctom
Update issue title and summary to target
enum
property type plugins only with this ticket for now. - 🇩🇪Germany hctom
Changed code to only target
enum
property plugins for now, simplified the implementation ofEntityFieldSource::getPropValue()
a little and usedEnumTrait::convertValueToEnumType()
for the final (rectified) return value.Looking forward to the new review results and please don't forget to say something about the idea to log invalid values.
- First commit to issue fork.
- 🇫🇷France just_like_good_vibes PARIS
hctom, Pierre,
yes sorry i have continued the work from hctom but moved the logic to the prop types, which is more natural.
the code is almost ready.
i will try to finish for tomorrow morning, and also add a few more tests. - 🇫🇷France just_like_good_vibes PARIS
i added some tests to the MR too,
let's discuss asap? -
pdureau →
committed 51e6a635 on 2.0.x authored by
just_like_good_vibes →
Issue #3488879 by hctom, just_like_good_vibes, pdureau: Define...
-
pdureau →
committed 51e6a635 on 2.0.x authored by
just_like_good_vibes →