Closed (fixed)
Project:
Select (or other)
Version:
7.x-3.x-dev
Component:
CCK / Field API widget
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
28 Jun 2013 at 05:10 UTC
Updated:
1 Apr 2014 at 15:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dboulet commentedThere are two problems with the way that the title for the widget is handled, when the field is required:
This means that the required marker is not displayed because the visible title belongs to the container element which is technically not required. Also, the validation message is not shown because the required select element has no title and can’t be named in the error message.
My proposed solution is to preserve the title for the select element itself and hide the container element’s title, see attached patch.
See related issue: #1736636: If it's required field and other is selected but not filled in the error reports with blank field title, message is 'required'
Comment #2
dave reidConfirmed regression in the 2.18 release with required select_or_other form elements.
Comment #3
rich.3po commentedAlso seeing this issue, in version 7.x-2.18
Patch in #1 solves the issue for me, thanks
Comment #4
shaundychkoWorks for me too, thanks a lot!
Comment #5
alauddin commented#1 - patch by dboulet works..thank you
Comment #6
haydeniv commentedCommitted:
2.x: 98d3760
3.x: 8b4c31c
and rolled a new release.
Thanks!
Comment #7
merzikain commentedIgnore this, I setup my own validator and wasn't handling the validation for no value properly.
Comment #8
twodThis commit borked the title display for checkboxes and radios, it's always invisible now. Setting #title_display to "invisible" is recursive in a way, since it just sets a class, and the stylesheets target any label with that class in a a parent.
Why not simply set $element['title'] = NULL? The sub-field already have a correct title? Works great for me.
@merzikain, it already fails validation if the "other" field is empty.
Comment #9
twodComment #10
dboulet commentedTwoD, by default the .element-invisible class is added directly to the parent label element—this shouldn’t affect any other labels. Maybe your theme treats it differently?
In any case, setting the parent element’s title to NULL should be ok, I think.
Comment #11
haydeniv commentedThis back and forth has gone on long enough with this widget. Every time we commit something, we break something else. No more commits until we get test coverage.
#1969084: #Meta Automated tests
Comment #12
twodHmm, I was using this in a webform, and just noticed it does most/all the select_or_other integration on its own, which is a bit of a WTF since it's missing several options controlling the "other" field... That's probably where my problems begin.
Comment #13
haydeniv commented@TwoD Can you open a separate issue for yours as this one is dealing with the Field API widget and yours is the webform widget? Thanks.
Comment #14
thekevinday commentedThe patch from #8 solves the issue.
For me, this is an accessibility issue in that when the title is defined, it gets assigned a 'for='some_field'.
When that field does not exist, then we have an accessibility problem.
Setting the title to NULL prevents the parent label from being created.
Comment #15
goldlilys commented#8 solved this issue for me too. Thanks.
Comment #16
kaidjohnson commentedIt makes no sense to attempt to retain the wrapper title if that title is being copied down to the ['select'] element anyway, so removing the wrapper title altogether is the ideal solution. +1 for #8 - worked perfectly.
Thanks!
Comment #17
kaidjohnson commented#8 is technically a patch that resolves #2072857: Webform component's Label and Description do not display in select_or_other-2.19 -- I'm moving the patch over to there per @haydeniv's request in #13 and updating that post's status to needs review. Closing this one as fixed, as the patch has already been committed to the project.