inline_edit Relatives

edited March 2020 in Bug Reports

Using fuel_edit() in a view, I can edit individual fields for a simple model.
If the model contains relatives, fuel_edit() does not not work:

For example, In my shops_model, I have:
function form_fields($values = array(),$related = array()) {
$related = array('glossary_state_counties' => 'resolve_distribution_model');
$fields = parent::form_fields($values,$related);
$fields['shopid']= array('type'=>'number','displayonly'=>TRUE,'label'=>'ID');
$fields['glossary_state_counties']['label'] = 'Distribution';
...
}

The glossary is a humanised list of counties ([countyid], [county]). The resolve is a one-to-many table listing branches of a shop and their counties: ie: [shopid], [countyid]
In shops_model, I have hooks to CRUD manage the resolve. As far as Fuel is concerned, the field name for this is [glossary_state_counties] and presents a multi-select field for populating it.

fuel_edit("{$shop['shopid']}|glossary_state_counties","List of locations",'glossary_state_counties_model'); fails however. Presumably because [glossary_state_counties] is not a "real" field, it's a virtual(?) field?

Any suggestions?

Comments

  • When you say it fails, are you seeing errors in the console or simply nothing is being updated? Also, did you try the module name instead of the model name for the 3rd parameter (e.g. "glossary_state_counties")?

  • I guess you're implying it should work? I just assumed that because my stuff was a bit weird then it was just not supported. I'll play at my end...

Sign In or Register to comment.