I found this error i don't know if it is a bug or something, But if you try to add a column in unique_fields() and if you edit it, it will throw an error if that field is empty. Saying that
"The field name doesn't exist in the database. ".
"Please use the unique fields only for fields ".
"that exist in the database"
Question why is this line https://github.com/scoumbourdis/grocery-crud/blob/master/application/libraries/Grocery_CRUD.php#L805
Checking for the unique_fields() value rather than checking the availability of that column? what if i have unique fields that are default no data? i have been surfing for a day now and can't seem to find any answers, so i created mine , if anyone have a better answer let me know.
On line 805/ libraries/grocery_CRUD.php
$database_columns = array_keys((array)$row); if(!in_array($field_name,$database_columns)) { throw new Exception("The field name doesn't exist in the database. ". "Please use the unique fields only for fields ". "that exist in the database"); } $previous_field_name_value = $row->$field_name; if($previous_field_name_value != $field_name_value) { $form_validation->set_rules( $field_name, $field_types[$field_name]->display_as, 'is_unique['.$this->basic_db_table.'.'.$field_name.']'); $form_validation_check = true; }