CCK checkboxes still behave as optional

pauline_perren - December 4, 2008 - 06:01
Project:Checkbox Validate
Version:6.x-1.1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

I installed this module to fix a problem where a checkbox in a content type I had created using the CCK behaved as an optional field even when marked as required. It made no difference at all unfortunately.

I had a look at the code and I've put in a fix. With this new code the checkbox behaves as a required field should but I was unable to find a way to automatically mark it as required (i.e. with the asterisk showing next to the field). I have worked around this in my site by putting the span tag needed at the end of the on description. I've attached a screenshot of the CCK checkbox configuration which I hope will make this a bit clearer.

The patch is against checkbox_validate 6.x-1.1 and I'm running Drupal 6.6

The CCK checkbox field is of a different type to the one in the registration form, I've updated the code to check for this new type and handle it as well.

There was also what looks like a typo in the original code that may have stopped it working for checkboxes in the registration form, there were two parameters being passed into the checkbox_validate_recurse function which only expected one. I've fixed it and the module definitely works for the registration form with this version but I didn't test it before the fix.

AttachmentSize
cck_checkbox_configuration_screen.png188.12 KB
checkbox_validation-update-for-cck.patch1.7 KB

#1

Anybody - February 2, 2009 - 17:00

Thanks, it works!

But anyway... this heavy drupal-bug has to be fixed!! Immediately!!!

#2

bensemmel - April 21, 2009 - 20:38

Thank you, with the patch the module worked for me as well...

#3

josi123 - May 13, 2009 - 14:51

thanks it worked.

#4

geraldito - May 18, 2009 - 18:54

Thanks a lot! Also fixes broken Checkbox Validate module for me.

#5

mcaden - June 27, 2009 - 07:14

validates (reports error if not set), but doesn't seem to mark as required with the asterisk or outline in red.

#6

nsputnik - July 20, 2009 - 05:21

Checkbox Validate is not working for me. What an annoying bug! Running D6.13, CCK 6.x-2.4.

#7

brisath - August 7, 2009 - 09:30

Subscribing

#8

bart.vandendriessche - August 19, 2009 - 07:54

Thanks for submitting that patch, worked like a charm for me.

#9

hubkei - September 3, 2009 - 12:01

Using D6.13 with 6.x-2.5 and neither the "Check Validate Module" nor this patch work for me. What a pity.

#10

spicy_tuna - September 3, 2009 - 21:13

Check the issue queue, you will find an updated patch here -- http://drupal.org/node/425096

 
 

Drupal is a registered trademark of Dries Buytaert.