Closed (won't fix)
Project:
Better Select
Version:
5.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Oct 2008 at 10:53 UTC
Updated:
6 Sep 2013 at 20:00 UTC
This module conflicts with Autocomplete Node Finder (see this comment). Not sure where the conflict is, but basically, it replaces one of the multi-select forms in the module settings and thus renders it impossible to select "none". The comment above explains this properly - sorry for the brevity of this post but I'm really busy and I just wanted to make sure people were aware of the conflict.
Comments
Comment #1
danielb commentedI think this problem comes from me processing the form results myself, and not doing it in a way that I expect the results array to be in form given by checkboxes.
my form element is set like so
the data is saved like this
and then when I read it back, I process it a little like this
I've learnt this technique from other modules, because there is no way with FAPI to create an easy 'select none' option. Most people don't know you can ctrl-click to unclick all the options (Better Select is lovely module by the way :P ).
Now when you go to the page (with Better Select) and are presented with the checkboxes, there is no "none" option - which should be fine since we don't need it, and doing the unset on the empty string option would have no effect anyway, right? But when I submit with only the 'none' option selected, I read the values of $my_element back, I get the unchecked values back in the array too.
I haven't investigated this but I suspect you convert the values to an array where the keys are the keys of ALL the options, and the values are either 0 or 1 depending on whether it was checked. Because I am using a select, my module doesn't expect to have the unselected options there. I think that's what is going on, but like I said I have not investigated this. Select options give their results as $value = $value I think, not $value = BOOLEAN as checkboxes do.
So the question is, is it my responsibility to be doing an "if ($v)" before using each option value, or should Better Select be giving me my original array?
Comment #2
danielb commentedhaah!! I looked in your code and you have made a fix in there for the taxonomy module!
$options[$tid] = $tid;There's the magic line in betterselect_taxonomy_from_checkboxes(), now that function does other taxonomy specific stuff, but this particular idea could be extracted into another submit process and every select form could be put through this.
also you should do something like this to stop overriding other submit functions http://drupal.org/node/58689
Comment #3
john franklin commentedDrupal 5 is no longer supported. If this is still an issue in 6.x or 7.x, please open a new issue.