Closed (fixed)
Project:
Webform
Version:
7.x-4.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 May 2015 at 15:27 UTC
Updated:
27 Jul 2015 at 11:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
danchadwick commentedThis seems to be a regression resulting from #2077237: Accessibility Issue with File Elements: Form Label Not Associated With Input.
The issue seems to be two-fold:
Comment #2
danchadwick commentedThis is also related to #1147994: Wrap composite elements in a fieldset element. We are using a label element and for some the target of the for attribute doesn't exist when the component has multiple elements within it, such as a date (month, day, year), time (hour, minute, am/pm, select components (checkboxes, radio buttons), grids, file components, and perhaps others.
The other issue is we seem to have two elements with the same id -- the wrapper and the file element.
And last, I don't know why the patch to add -upload to the id was needed, nor why it isn't needed now. In my testing, the id already ends in -upload.
Comment #3
danchadwick commentedAnd there's this issue, which was bumped to D8: #945438: Prevent label @for from pointing at non-existent @id.
I think the "for" attribute will have to wait for a fix, maybe the duplicate id can be addressed.
Comment #4
Jeremy JOCHEMSKI commentedHello Dan,
I find the location where the item "-upload" is added :
file ./webform.module
line 3579
I just comment this line and it's ok ! ( I need an hotfix quickly :) )
For the duplicate id, i think it's a core issue :
See the function "theme_file_managed_file($variables)"
https://api.drupal.org/api/drupal/modules%21file%21file.module/function/...
It create an attribute id with the same element id (the file input id) :
And after, it add the div before render the file input :
So, every time, it do duplicate id, into the div and file input elements.
Best regards,
Comment #5
Jeremy JOCHEMSKI commentedI have open this issue for the duplicate id :
https://www.drupal.org/node/2497909
Comment #6
danchadwick commentedPlease review this patch to see if it
Jeremy -- please remove any theme overrides or webform patches you may have used to work around this issue before applying the patch.
Comment #8
danchadwick commentedSince the crux of this seems to be a core issue, I think we should call this a task, rather than a bug report. Also changing the version so testbot can work.
Comment #10
danchadwick commentedTest failures are unrelated to this patch.
Comment #11
fenstratTricky issue. The fix does point towards the issue laying with core, #6 seems like it will work but the key is checking for regressions with js/css.
@Jeremy JOCHEMSKI can you confirm #6 fixes your issues?
Comment #12
liam morland#6 looks good to me.
Unavoidably, custom CSS and JS could be effected since the selectors are changing. It would be an easy fix, however. Core must have made changes in the same area without creating a huge issue, however, so this may not be a big deal. Still, there should be a warning in the release notes.
Comment #13
danchadwick commentedWith some hesitation, I committed this even though most of the patch is working around the core bug. Should this be fixed in core, the theme function should be removed, if possible, before webform-8.x is stable.
Committed to 7.x-4.x and 8.x.
Changing this back to a bug report since this patch also removes the duplicated '-upload' that was added to the id.