Closed (fixed)
Project:
UI Patterns (SDC in Drupal UI)
Version:
2.0.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
21 Nov 2024 at 09:26 UTC
Updated:
6 Dec 2024 at 14:54 UTC
Jump to comment: Most recent
Comments
Comment #2
hctomComment #3
pdureau commentedComment #4
hctomUpdate to issue summary to name the right
typed_datavalues for number fields (becausenumberis not correct there / not available as typed data type)Comment #5
hctomRemoved
decimalfrom list oftyped_datavalues to add, because there is notList (decimal)field type in Drupal.Comment #6
hctomComment #8
hctomSo, finally got the time to create my first draft for this:
typed_datavalues to theenum*PropType pluginsNULL(if property is optional)...and another idea: Should invalid field values be logged somehow?
Looking forward to your review ;)
Comment #9
pdureau commentedi will have a look
Comment #10
pdureau commentedComment #11
pdureau commentedComment #12
pdureau commentedHi Tom,
Tested with enum, it works well, thanks a lot
However, you did the change also for
enum_setandenum_listand I am struggling to see the use cases this is covering:What is the best way of testing integration with
enum_setandenum_list?For information,
enum_setis an array of values where:enum_listis an array of values where:Comment #13
pdureau commentedFollowing our Slack discussion, I believe we need to focus on
enumprop 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.
Comment #14
hctomUpdate issue title and summary to target
enumproperty type plugins only with this ticket for now.Comment #15
hctomChanged code to only target
enumproperty 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.
Comment #16
pdureau commentedMikael, what do you think about this proposal?
Comment #18
pdureau commentedMove the logic to
::normalize()and add an optional prop definition paramater.Move some logic from EnumTrait to
::normalize()? Careful because this trait is also used in sources.Comment #20
just_like_good_vibeshctom, 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.
Comment #21
just_like_good_vibesi added some tests to the MR too,
let's discuss asap?
Comment #23
pdureau commentedComment #24
pdureau commented