Project:Explainfield CCK widget
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:needs work

Issue Summary

If allowed number of values is set to anything other than 1 then rather than displaying the options as checkboxes a repeating field type with multiple instances of the radio options list is displayed. Drupal version 6.10. Screenshot demonstrating 'Unlimited' option attached

Cheers.

AttachmentSize
Picture 4.png46.33 KB

Comments

#1

this looks like it is by design but it makes the module unusable for us, which is a darn shame.

#2

hopefully i will look into the 6.x version in a short while when i got some time.

#3

Subscribing, please get this potential great module for D6 working please!
Thanks a lot in advance!
greetings,
Martijn

#4

This is definitely a problem. I'm trying to investigate now, but I'm not to0 familiar with the cck api. So far, It doesn't seem as if explainfield is looking at the $field['multiple'] setting at all. The processing for multiple values is using a count() on the actual allowed values options. That seems incorrect to me.

The way I understand the 'multiple' column of cck fields is:

$field['multiple'] == 0 - means no multiples allowed and therefore the number of values is 1 (seems a little backwards at first glance, until you think about the fact that setting is named 'multiple').

$field['multiple'] == 1 - means 'unlimited' values

$field['multiple'] > 1 - the actual number of allowed values

I don't see any of this logic in the explainfield module. It simply does a text replace in the html for radios/checkboxes. I'll try to keep plugging away.

#5

Status:active» needs review

I think i've found it. Patch attached.

AttachmentSize
explainfield_checkbox_fix_449512.patch 1.13 KB

#6

Status:needs review» needs work

Yeah, the statement in #2 is absolutely correct. This module does not implement multiple properly, the current solution is a hack. The patch does resolve it to a certain degree (form error is thrown still on the configuration form when selecting multiple values), but I think we need to find a solution that implements the multiple option just like the cck select widget.

nobody click here