Closed (fixed)
Project:
Webform
Version:
7.x-4.0-rc3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Feb 2014 at 11:57 UTC
Updated:
7 May 2014 at 10:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
sah62 commentedComment #2
sah62 commentedThe issue still exists in beta3.
Comment #3
quicksketchThanks, do you know if this is an issue specifically with Select or Other? On a normal form, I'm not seeing this error. My guess is that the "other" textfield may not have a #title attribute.
Comment #4
sah62 commentedI'm not using Select (or other). Is there something else I can look at to better describe my form? I have Devel installed and can add some debugging code if it helps.
Comment #5
sah62 commentedI've done a little debugging to see what's happening when attempts to reference $element[$key]['#title'] produce an "Undefined index" notice. In each case the iteration of the foreach loop is attempting to process a multicolumncheckboxesradios-table-open element that is itself an array of elements, none of which is "#title". I've attached a screen shot that shows one sample value of $element[$key].
The issue here is in the way the Multi-column checkboxes radios module constructs these elements. It doesn't include a title, which means that we can safely not worry about it containing scripts or CSS. One way to fix this would be to check if $element[$key]['#title'] is set before attempting to reference it. That is, change this:
$element[$key]['#title'] = webform_filter_xss($element[$key]['#title']);to this:
Does this look reasonable?
Comment #6
sah62 commentedHmm, I have a short memory :). I just did some digging through the issues queue for the Multi-column checkboxes radios module and found an issue (#1600540: Undefined index: #title in webform_expand_select_ids()) that I submitted in May 2012 that includes a patch to add the #title elements. It apparently still hasn't been committed.
Comment #7
sah62 commentedThis issue still exists in 7.x-4.0-rc1. Please see above for a suggested fix.
Comment #8
quicksketchThanks @sah62! Let's make this "needs review" even though there isn't a patch yet, there's a suggestion on how to fix this.
Comment #9
danchadwick commentedMight be safer to use the form:
or
That way any subsequent code that relies on $x being defined won't throw an warning.
Comment #10
sah62 commentedPatch attached with @DanChadwick's suggestion incorporated.
Comment #12
quicksketchHmm, I may have broken tests. The failure to even install is clearly not this patch's fault.
Comment #13
sah62 commentedThis issue still exists in 7.x-4.0-rc3.
Comment #14
sah62 commented10: webform-2195305-10.patch queued for re-testing.
Comment #17
quicksketchThanks @sah62. I've committed this to 7.x-4.x. The test failures are driving me crazy. I'm trying to figure out their cause in #2244979: Figure out why testbot is failing all patches.
Comment #18
fenstratNeeds porting to 8.x-4.x.
Comment #19
fenstratCommitted and pushed 6b76112 to 8.x-4.x. Thanks!
Comment #21
sah62 commentedThank you!