Validation of empty but required widgets results in uninformative error

ramriot - June 12, 2009 - 20:59
Project:CCK Taxonomy Super Select Ultra
Version:5.x-1.1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Hi,
Not just a bug report but a patch as well. I cam across this while using the module on a production site. When a field is required but a user leaves it unset a validation error results. The error though does not say which field is in error. I've made the following patch locally so for anyone else here is mu code:

Line 389 of cck_taxonomy_ssu.module
FROM>
form_set_error($field['field_name'], t('You must select at least one term.'));

TO>
form_set_error($field['field_name'], t('You must select at least one term for @field.', array('@field'=>$field['widget']['label'])));

 
 

Drupal is a registered trademark of Dries Buytaert.