Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
forms system
Priority:
Minor
Category:
Task
Assigned:
Reporter:
Created:
11 Mar 2006 at 07:01 UTC
Updated:
10 Dec 2010 at 21:36 UTC
Jump to comment: Most recent file
This has been spliced from http://drupal.org/node/53351
To reproduce:
-Create a multi-select vocabulary and associate it with a node type. Populate it with a few terms.
-Create a node of this type and associate it with some of the above terms.
-Edit the node, remove all the terms from said vocabulary. Click Preview or submit.
-The changes are not saved and the default values are stored.
It is assumed that the issue linked above has been committed..
-K
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | posted.patch | 1.11 KB | chx |
| #5 | 20060311jv.patch | 701 bytes | jvandyk |
| #2 | 53480_form_default_values_0.patch | 751 bytes | Zen |
| #1 | 53480_form_default_values.patch | 1.08 KB | Zen |
Comments
Comment #1
Zen commentedI don't really grok form.inc, but here's a shot at this. Patch attached.
I'm not sure of the ramifications of this - esp. w.r.t. multipart forms, nor am I sure about the needs_validation statement. Please test thoroughly.
Thanks
-K
Comment #2
Zen commentedAnother approach?
Please review both patches.
Thanks
-K
Comment #3
chx commentedComment #4
kkaefer commentedBoth patches from Zen work for me flawlessly. I'd take the second patch though.
Comment #5
jvandyk commentedSecond patch works. Tested with multiple multiple-select vocabularies. This patch is the same; just makes comment style and terminology consistent.
Comment #6
chx commentedNow you can not temper with a simple checkbox, before it was not checked. We remove linebreaks from mere textfields, there is no way this breaks user data, only hackers are interested. This puts many header injection attacks at rest. And yes, we care for empty selects. And last, but not least, we make the whole thing readable.
Comment #7
kkaefer commentedchx' patch works for me.
Comment #8
dries commentedHow about:
instead of:
Comment #9
kkaefer commentedDries, trim does only remove leading or trailing whitespace, not line breaks within the string. Probably use both.
Comment #10
Zen commentedPatch applies cleanly. Testing:
+1
-K
Comment #11
chx commentedDries, you do not want to merely remove the ending \r \n but all instances of them. On the other hand, you do not want to remove spaces in the beginning for example. So I fail to see how trim is appropriate here.
Comment #12
dries commentedNevermind my comment. chx is right. :)
Comment #13
dries commentedTested the patch. Committed to HEAD.
Comment #14
moshe weitzman commentedZend said: "#requireds work as expected on all elements."
The required it on a checkbox is being ignored. The use case for required checkbox is on trms of service agreements and so on. The user should not pass validation until checkbox is checked.
Further, the CSS on a required checkbox is different from other form elements and thus isn't getting styled properly.
Not sure if this report belongs here but is good for now. At least is out of my head.
Comment #15
moshe weitzman commentedfor testing, the easiest way to add a required checkbox is to use admin/settings/profile
Comment #16
moshe weitzman commentedoops. my checkout was stale. the validation works now. class attribute is different though and appears unrequired in bluemarine
Comment #17
LAsan commentedchx: Still an active task?
Comment #18
alexanderpas commentedseems fixed to me, using the method from #15 the indicator displayed correctly.