Closed (outdated)
Project:
Drupal core
Version:
6.22
Component:
forms system
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Apr 2010 at 22:59 UTC
Updated:
2 Mar 2016 at 22:18 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
crashtest_ commentedHere is a patch for the file module.
Comment #2
chx commentedComment #4
lut4rp commentedThe patch attached in the issue doesn't apply cleanly, I re-rolled it, attaching again.
Comment #5
crashtest_ commentedCleaned up whitespace.
Comment #6
cwgordon7 commentedThe patches in #4 and #5 are identical except for the fact that #5 is not properly rolled (should be done from the Drupal root directory). Setting to needs review for #4. lut4rp, you'll need to repost that patch so the testing bot knows what's up.
Comment #7
lut4rp commentedAgain, re-rolling and posting.
Comment #9
drewish commentedThat seems sane to me. I wonder if we'll need to make changes to the javascript though.
Comment #10
crashtest_ commentedThanks to dmitrig01 for the js help on this patch!
This is still producing the following warning, however the disabled managed file fields stay disabled now.
Warning: Cannot use a scalar value as an array in _form_set_value() (line 1897 of /Users/pteglia/Sites/drupal/includes/form.inc).Comment #11
crashtest_ commentedComment #12
crashtest_ commentedCleaning up patch, removing console call.
Comment #13
berdirWe recently changed the behavior of #disabled, see #426056: Server-side enforcement of #disabled is inconsistent just wondering if there is anything to do because of that, for example, pass the #disabled attribute through too.
Comment #14
effulgentsia commentedsubscribing for review later.
Comment #15
yesct commented#12: 776956-managed-file-attributes-3.patch queued for re-testing.
Comment #17
catch#12: 776956-managed-file-attributes-3.patch queued for re-testing.
Comment #19
mr.baileysRe-rolled to keep up with HEAD. I changed
to
as it feels icky to indiscriminately copy all attributes to the child components of the file element.
Comment #20
yesct commentedindenting might be needed here...
Powered by Dreditor.
Comment #21
yesct commentedleft as needs review because I only looked at the style real quick, nothing functional.
Comment #22
chx commentedMake Form API inherit #disabled and slap a #disabled on the widget container in field.form.inc. This issue is not about file.
Comment #23
chx commentedAh so it's not a setting much rather something like the a form alter that adds a disabled. Then this little patch should suffice.
Comment #24
damien tournoud commentedAdded two tests:
- #disabled is recursively validated (values below a #disabled container cannot be altered) [this was working before]
- #disabled is recursively added to the HTML [this is what this patch fixes]
Comment #26
damien tournoud commentedAnd with a non-broken inheritance logic, it should pass better :)
Comment #27
chx commented*blushes* OK. I am dumb. But the logic was sound :)
Comment #28
effulgentsia commenteds/isset/!empty/
I had to read this 10 times before understanding what was being done. I changed it to what makes more sense to me. Please see if I captured the intent correctly.
60 critical left. Go review some!
Comment #29
chx commentedwhether !empty or isset, does not matter, who cares if we inherit #disabled false? I am fine with either, but it should check for !isset($element[$key]['#disabled']) so that we do not squash an existing one
Comment #30
effulgentsia commentedAre you sure? Don't we want it just like #access? What's the use-case for a disabled parent and a non-disabled child?
Comment #31
chx commentedI have no idea but if you explicitly set #dsabled to FALSE we better honor that. It's a very edge case.
Comment #32
effulgentsia commentedOk. In fact, it's what we were already doing for checkboxes and radios, so this cleans that up.
Comment #33
marcingy commentedPatch works as advertised with complex widgets. Although I think some more involved with the issue should mark it RTBC.
Comment #34
yesct commentedline too long (80 char max)
45 critical left. Go review some!
Comment #35
effulgentsia commentedFrom http://drupal.org/node/1354#general
Comment #36
coltraneStill applies and works, also the disabled fields can't be gamed from what I can tell.
Comment #37
marcingy commented#32: 776956-disabled-inherit-32.patch queued for re-testing.
Comment #38
effulgentsia commentedAccording to http://drupal.org/community-initiatives/drupal-core, #690980: Disabled form elements not properly rendered is a beta blocker. This issue is a pre-req for it, making this issue a "beta blocker blocker". Reflecting that in the issue title.
Comment #39
sun#32: 776956-disabled-inherit-32.patch queued for re-testing.
Comment #40
webchickSorry; took me awhile to get brain-space to look at this. And... looks good! And comes with tests to make sure it works.
Committed to HEAD. Thanks!
Comment #42
marthinal commentedLittle patch to disabled password_confirm correctly in D6.
Comment #43
albert volkman commentedUpdating status. Ignore testbot fail.