Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Comment | File | Size | Author |
---|---|---|---|
#27 | interdiff.txt | 4.06 KB | Striknin |
#27 | 2894033-22.patch | 10.99 KB | Striknin |
#22 | 2894033_content.png | 8.04 KB | hmendes |
#22 | 2894033_config.png | 55.64 KB | hmendes |
#21 | 2894033-21.patch | 9.64 KB | FranckyLFS |
|
Comments
Comment #2
icf-vpathak CreditAttribution: icf-vpathak commentedHi,
I used this module on Drupal 7 and I know that we could change the label/title of the Other option. I add this module on Drupal 8 and I was not able to see those options where we could update the label of 'Other'. Can anyone please help me with this?
Also, thanks for such a cool module :)
Comment #3
icf-vpathak CreditAttribution: icf-vpathak commentedComment #4
daggerhart CreditAttribution: daggerhart as a volunteer commentedThis patch provides a widget setting for changing the Other option label. If no label is set, it defaults back to "Other". Patch is against -dev branch
Comment #5
Tsymi CreditAttribution: Tsymi at Axess Open Web Services commentedPatch proposed by daggerhart in #4 worked for me thanks !
Comment #6
nkoporecTested the patch and it works great.It adds the ability to change Other text.Great work!
Comment #8
francoud CreditAttribution: francoud commentedWill this patch ever commited to *dev version at least?
Comment #9
legolasboYes @francoud,
When it reaches
Reviewed & tested by the community
statusComment #10
cgoffin CreditAttribution: cgoffin at Sopra Steria commentedI adjusted the patch to make the other option text and the other option field label configurable (as in D7).
Comment #11
Sutharsan CreditAttribution: Sutharsan at LimoenGroen commentedThe labels should be translatable too. That requires a schema definition.
Docs: https://www.drupal.org/docs/8/api/configuration-api/configuration-schema...
Comment #12
douggreen CreditAttribution: douggreen as a volunteer and at Tag1 Consulting commentedIMO this works well enough to commit, and the translation of the new labels could be a follow-up issue, so I'm marking it as RTBC.
Comment #14
foxtrotcharlie CreditAttribution: foxtrotcharlie as a volunteer commentedThis adds the missing schema definitions.
Comment #15
legolasboThe patch looks good, but I'd like to see some tests added to cover this functionality.
Comment #16
devan.chase CreditAttribution: devan.chase commentedI've updated the patch to work with the latest dev release. This patch also adds a placeholder setting and fixes the placeholder attribute overriding the aria-label.
Comment #17
devan.chase CreditAttribution: devan.chase commentedComment #18
devan.chase CreditAttribution: devan.chase commentedThe patch has been updated to work with the latest dev release and also adds a placeholder setting and fixes the placeholder attribute overriding the aria-label. This patch stills needs to have the updated test cases to cover the new functionality.
Comment #19
Ollie222 CreditAttribution: Ollie222 commentedIf it helps the patch in #18 applied cleanly to dev 1812d2bcd0 and looks to work for my use case including the placeholder and label settings.
Comment #20
nikitagupta CreditAttribution: nikitagupta at Srijan | A Material+ Company for Drupal India Association commentedfixed test case failure.
Comment #21
FranckyLFS CreditAttribution: FranckyLFS commentedBased on patches #18 and #20, I saw that the placeholder attribute was there, but it was not used in ElementBase. The #other_placeholder property did not override the value. So, I added it and it's functional now.
Comment #22
hmendes CreditAttribution: hmendes at CI&T commentedTested the patch from #21 and it worked for me, changing this to RTBC.
Steps:
Attaching screenshot for reference
Comment #24
daften CreditAttribution: daften at Dropsolid commentedCommitted, thanks for the patch all!
Comment #25
daften CreditAttribution: daften at Dropsolid commentedComment #27
Striknin CreditAttribution: Striknin at Klee Interactive (Klee Group) commentedHello,
This patch was very usefull into my project, thanks for that.
But :
The main wrapper should be a container instead of a form_element.
This allows to have inside only the fields that interest us (select and other), without label not joined with select or input.
All fields, should have a "#title"
But actually with patch 21, "Other" field doesn't have one if settings are empty. In case of use of "Clientside validation" or other module like this, errors can't be display with the name of the field. Instead there is a "This field field is required." for example.
Settings that we can customize (Label, name of option, placeholder) should be translatable.
This can simply be possible with the use of t() function in some places. We should maybe, make these settings translatable with the use of config translation and UI, it should be more proper.
I've created a patch, applied on tag 4.0.0 to include these modifications, I propose it in attachments (with interdiff patch).
If I can, I will post a patch that can apply on default branch (dev)