CNR.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | filefield_295896.patch | 2 KB | drewish |
| #10 | filefield_295896.patch | 3.37 KB | drewish |
| #9 | filefield-optional-description-295896-9.patch | 3.3 KB | webchick |
| #6 | filefield-description.png | 70.24 KB | webchick |
| #5 | filefield-optional-description-295896-5.patch | 2.29 KB | webchick |
Comments
Comment #1
drewish commentedi'm all in favor of this feature. i've been after_building this out... that said i'd like to change description_visibility => show_description.
Comment #2
amitaibuchanged description_visibility => show_description
Comment #3
amitaibuChanged also title of form field.
Comment #4
webchick+1 for this. No longer applies. Looking into it...
Comment #5
webchickRe-roll. Patch is the same except I changed the field description from:
to:
Now, to test it. ;)
Comment #6
webchickI tested with an ImageField, with the checkbox both on and off. Confirms that this patch solves the problem.
The UI for the field configuration a little funny. I've uploaded a screenshot. I missed this the first time and thought the patch wasn't working because it didn't have a Show description: above it. OTOH, it's a single checkbox, and the "Required" single checkbox at the top doesn't have a description either, so adding one would be inconsistent. I thought about moving it further up in the form, but "Default list value" and "How should the list value be handled?" are required, so it makes sense that they appear first in the list.
I'd be for committing this patch, and then making a follow-up issue for "Make the field settings UI a bit easier to use" Maybe one of the things we could deal with there is the awkward "?:" at the end of "How should the list value be handled?" :)
Comment #7
drewish commentedI'd like to see this as radio buttons to follow the existing pattern since they allow for clearer labels. checkboxes always require much more explanation.
Comment #8
webchickOk, one moment...
Comment #9
webchickOk this patch has a little bit more changed than the last one. Allow me to explain:
I started out by copying the same isset($foo) ? $foo : 0 logic from the other two fields. However, when I tested it, I noticed that this is setting all of these fields to have nothing selected by default. That's annoying. It happens because these fields are instantiated somewhere with a value of '' (empty string) so they are in fact set, even though they are invalid choices.
So I changed the logic on each one to instead be empty($foo) ? 0 : $foo which by random sampling of people in #drupal was easier to grok than the inverse.
Patch for your review. :)
Comment #10
drewish commentedlooks good to me but it seems like the default should be to show descriptions to preserve the current behavior.
committed the attached to HEAD.
Comment #11
webchickYay! Thanks, drewish! :)
Comment #12
amitaibu@drupal.org commentedthanks guys and girls :)
Comment #13
webernet commentedUm...
empty(0) = TRUE, but disabled = '0'
Which means that the checking for empty() rather than isset() is wrong.
Marked #297934: Hide Description settings error. as duplicate.
Comment #14
drewish commentedthe problem is that it does get set to ""... so isset() doesn't work quite right either. looks like cck is always providing an empty value. committed the attached patch which checks for the empty string.
Comment #15
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.