We've found a little annoying bug in the validation handler of freetagging widgets. It fails when a field is shared between several content types, but they have different per instance settings.

The problem is the API used to retrieve the $field structure in content_taxonomy_autocomplete_validate(). It just passes the field name, and CCK returns information about just one field instance in that case.

It can be fixed by requesting the field information of the corresponding content type:

 function content_taxonomy_autocomplete_validate($element, &$form_state) {
   $field_name = $element['#field_name'];
-  $field = content_fields($field_name);
+  $field = content_fields($field_name, $element['#type_name']);
-  $field_key  = $element['#columns'][0];

This is one liner fix. Please, let me know if you need a formal patch. Thanks

Comments

markus_petrux’s picture

Status: Active » Needs review

Oops. I made a typo in the code above. Sorry.

function content_taxonomy_autocomplete_validate($element, &$form_state) {
   $field_name = $element['#field_name'];
-  $field = content_fields($field_name);
+  $field = content_fields($field_name, $element['#type_name']);
   $field_key  = $element['#columns'][0];
mh86’s picture

Status: Needs review » Fixed

yep, this has been missing. patch committed :) thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.