- Issue created by @zniki.ru
- Status changed to Needs review
12 months ago 6:29am 23 November 2023 - last update
12 months ago Patch Failed to Apply - 🇷🇺Russia zniki.ru
There is at least 2 solutions to fix it:
- Return back for textarea field for providing allowed value.
- Add field for email, and provide support for these fields.
- Combine 2 options, and allow user to chose between new UI with text field, and old with textarea.
If we are going to use option #1, it will takes less time to implement, but we are not using new Drupal UX
It's possible to copy old version of \Drupal\options\Plugin\Field\FieldType\ListItemBase to code base of the module, and then use it to extend Drupal\contact_storage\Plugin\Field\FieldType\OptionsEmailItem. It would be easier for experienced site builders to create new category, just copy "allowed values" from one field to another.To use option #2 a lot of changes to OptionsEmailItem needs to be made.
I make fast check, and it's easy to achieve with core patch (patch attached), but it takes a lot effort to implement it in OptionsEmailItem.
It would be great to be able to select form widget for allowed values as we do for fields, but this is impossible for now.Most user friendly is option #3, users can decide to use new form with textfields, or old one with textarea.
I think it would be great to discus it before starting implementing changes.
- Status changed to Needs work
12 months ago 7:56am 23 November 2023 - 🇨🇭Switzerland berdir Switzerland
I misunderstood this, forgot about this field type.
I'd suggest to just revert to the plain textarea UI.
The patch above seems to be against core.
- Status changed to Needs review
12 months ago 3:06pm 23 November 2023 - 🇷🇺Russia zniki.ru
Yes the patch in #2 is against Drupal core. After applied changes I was able to use 3 fields for allowed value. Key, Label, Email.
I provide it, as information for anyone who wants to experiment with implementing support for 3 fields.I create draft MR, just copied ListItemBase and renamed it from 18432dac and used it as parent for class OptionsEmailItem.
Do you think this is the right way?
- last update
5 months ago 8 pass - last update
5 months ago 8 pass - Status changed to Fixed
5 months ago 10:53am 22 June 2024 -
Berdir →
committed 1ba9d54c on 8.x-1.x authored by
Nikolay Shapovalov →
Issue #3403403 by Nikolay Shapovalov: Fix allowed values for field type...
-
Berdir →
committed 1ba9d54c on 8.x-1.x authored by
Nikolay Shapovalov →
- 🇨🇭Switzerland berdir Switzerland
I'm not sure if there would be a way to do it with fewer duplication or if we could somehow adapt the UI, but lets go with this as an initial fix. Merged to unblock failing tests.
Automatically closed - issue fixed for 2 weeks with no activity.