Conflict if "Data settings" not the same with Vocab setting
najibx - January 24, 2008 - 08:27
| Project: | Content Taxonomy |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | won't fix |
Jump to:
Description
Content Taxonomy via CCK allow us to put a Taxonomy field into a node (via CCK) just like if we were to check the content type where the particular Vocab should be available.
However, if in the vocab setting, you select this vocab allow multiples values, but in taxonomy_content, under the "Data settings" is not the same, it causes error such as below :
warning: Illegal offset type in C:\wamp\www\drupal\sites\all\modules\content_taxonomy\content_taxonomy_options.module on line 159.
Fortunately, immediate solution is, once I set both the same (allow multiple values), the problem is gone.

#1
Subscribing.
I've added a warning for this to Hierarchical Select module's submission guidelines. (This was initially reported by najibx in the Hierarchical Select issue queue, in this issue.)
#2
I'm not sure if it's because I enabled "allow multiple values" or it's a HS issue, but now, with a vocabulary that just saves the deepest term, the node page lists all the parents of that term...
anyway, Subscribing here...
#3
I've found something while debugging a cck form with form_alter. I have a taxonomy field with checkbox, multiple values and required widget options selected. Before submitting the node this field's #default_value contains an array with an empty string, but this is not equal to an empty choice.
Anyway, this code solved my problem:
<?php/* form_alter */
if (!is_numeric($form['field_something']['tids']['#default_value'][0])) {
unset($form['field_something']['tids']['#default_value']);
}
?>
#4
Hello,
Ouf, I'm happy to found this issue, now I can put a name on my problem : Hierarchy select was working
Parasite, I don't understand very well what you did to solve the problems : where and when ?
Thanks in advance for your help !
#5
Sorry, I think my solution should be an other issue, I didn't get that message that najibx described. Now I create a taxonomy field and select required and multiple values in widget settings, I've got an error message after submitting a node: "illegal choice detected", therefore the form item's default value is set to an array with an empty string (like this: array(0 => "")) and this is not the same when you set the default value to a real empty string without the array. In this way, the drupal's form validating process halts with message "illegal choice detected", because the selection (array(0=>"")) does not found in acceptable options. (You should get the message "selection is required"). I hope i was understandable...
#6
I have data settings and the vocab settings the same and I still get
warning: Illegal offset type in sites/all/modules/content_taxonomy/content_taxonomy_options.module on line 159
I don't know why at this point.
#7
I implemented
http://drupal.org/node/234622#comment-971032
and it seemed to solve the problem.
#8
The Drupal 5 version of this module is no longer maintained.