Hi,
I have this
$related['colors'] = 'products_to_colors_model';
$related['capacities'] = 'products_to_capacities_model';
$fields = parent::form_fields($values, $related);
but for some reason "capacities" is not pulling data from the database so no fields on the select combo are selected.
"colors" is working fine.
The data from both related tables are stored on database as expected.
Any toughts?
Thanks in advance!
Comments
$CI->$related_model_name->debug_query()
The problem was on the short name of the model.
Instead of capacitie_id, it should be capacity_id
I fixed it by doing a replace, like so
@preg_replace("/ie_id$/", "y_id", $CI->$related_model->short_name(TRUE, TRUE)).'_id'
on the "form_fields" method.¡
Thanks!