Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Label not appear on Single on/off checkbox
Comment | File | Size | Author |
---|---|---|---|
#1 | cck_checkbox_label.patch | 596 bytes | gstratis |
Comments
Comment #1
gstratis CreditAttribution: gstratis commentedThe issue is in line 114 of optionwidgets.module
I found that replacing with the code below resolves the problem.
Comment #2
z.stolar CreditAttribution: z.stolar commentedThe correction does put the label in place, but the default value is not kept (I'm not sure it's the same issue)
Comment #3
gstratis CreditAttribution: gstratis commentedNot the same issue.
Regardless, I've tried to reproduce your problem and I can't, the default value appears just fine on new nodes and on editing existing ones. You should probably submit another issue with more details about how you setup your checkbox, and what the real behaviour is vs the expected one.
Comment #4
z.stolar CreditAttribution: z.stolar commentedI found this solution as well:
http://drupal.org/node/149103
Comment #5
dgtlmoon CreditAttribution: dgtlmoon commentedrelated to http://drupal.org/node/120377
Comment #6
yched CreditAttribution: yched commentedSingle On / Off checkboxes use the label of the 'on' value, defined in the 'allowed value' textarea.
For instance :
I agree that is might look counter-intuitive, but I'm not sure of the reasons why it was implemented that way to begin withh, plus changing that now will break existing fields. I updated the help text to make that a little more obvious (1.6 release)
Comment #7
gstratis CreditAttribution: gstratis commentedThis is not just counter-intuitive, it's plain confusing :) There are two fieldsets with form elements allowing a user to define the checkbox:
There exists a fieldset called "Widget Settings", in which the user fills in a "Label" text field. Intuitively, this should be the checkbox label. In fact, it's so intuitive that whoever created this form even used it as a label in the "Default Value" field, which shows a checkbox for the user to check or uncheck as default.
IT gets even worse when one considers what will happen if you have set the label using the "Allowed Values" label in the "Data settings" fieldset. You will have a checkbox with label A in your node form (where A is what you defined in the allowed values textarea) and you will have a label B in your "Default value" checkbox ( where B is what you defined in the "Label" text field ).
Someone please explain why the "Data Settings" fieldset, which contains all the data related settings, would have anything to do with the label of the checkbox? If there is a reason, I'm just not getting it.
Comment #8
KarenS CreditAttribution: KarenS commentedWe don't need two threads with identical discussion, so keep further discussion in http://drupal.org/node/120377.