Hi there -- I've been using VBO to bulk-update the taxonomy terms of nodes using "taxonomy autocomplete deluxe" widgets. Couldn't do this for awhile--kept getting the attached error. I looked at the offending function, and the nodes that were causing problems, and saw that content_taxonomy_autocomplete_validate_deny_new_terms() was choking without a check to be sure that the array being foreach'ed had some values in it. I altered the function accordingly (see below), and VBO works fine now. Happy to roll a patch here if it helps, but my only change was to add the line at 106 checking for empty. -- Ben
function content_taxonomy_autocomplete_validate_deny_new_terms($element, &$form_state) {
// taxonomy_field_validate() is invoked before.
$field_name = $element[$element['#language']]['#field_name'];
if(!empty($form_state['values'][$field_name][$element['#language']])) {
foreach ($form_state['values'][$field_name][$element['#language']] as $delta => $value) {
if ($value['tid'] == 'autocreate') {
form_error($element, t('%name: new terms are not allowed.', array('%name' => $element[$element['#language']]['#title'])));
}
}
}
}
Comments
Comment #1
damienmckennaThis ought to fix the problem.
Comment #3
damienmckennaCommitted. Thanks.