ci-bonfire/Bonfire — Issue #280: Form Validation Class Extension -- unique()
Author: tgkelly
Created: 2012-01-12 22:55:47+00:00
State: open

I had problems when trying to use the 'unique' rule in form validation.

// extract the first parameter
line 44-ish
list($table, $field) = explode(".", $fields[0],2);

when $fields[0] contains "projects_proj_name.projects_proj_name.id.x"
$table then = 'projects_proj_name' and
$field then = 'projects_proj_name.id.x' which fails the following db request because of the '.id.x' which was generated by the 'Module Builder' in the form validation rule section of the controler(s).
I'm not sure whether this is a bug in the FV extension or MB is generating bogus parameters for the 'unique' rule.

In any event my band-aid was:

// extract the first parameter
list($table, $field, $dummy) = explode(".", $fields[0],3);
with $dummy being a throw away.