Is it possible to set a modules config field: display_field to a field in another table?
I have an area where I'm managing the relationship between entities. None of the fields in this table are suitable for a display but one of the id fields (FK) links to a table that does.
Comments
function _common_query() { parent::_common_query(); $this->db->select($this->table_name.'.* my_key_table.my_field'); $this->db->join('my_key_table', 'my_key_table.id = '.$this->table_name.'.my_key_table_id', 'left'); }
Doesn't quite crack it. I'm happy enough to keep hacking at it.
So far:
Problem comes from base_module_models::get_others which boils down to MY_Model::options_list
options_list() seems to not use MY_Model::get() so it doesn't pick up _common_query
I've dropped a:
if (method_exists($this, '_common_query'))
in there which is at least firing it.
I'm picking it'll probably turn to custard with the validation of submits though.
function options_list(key, $val, $where, $order) { $this->db->join('join1', 'join1.ref_id = join2.id', 'left'); return parent::options_list($key, $val, $where, $order); }
Cheers for your help.