Possible bug on filtering table by column keyword

I have noted a problem on filtering the view tables by keywords when there is a reference to other tables. The filtering process is not working. Give a look to this screenshot

The reference are defined correctly with these declarations in the controller:

        $this->grocery_crud->set_relation('units_of_measure_id','units_of_measure','{unit_of_measure} ({id})', null, 'unit_of_measure');
        $this->grocery_crud->set_relation('languages_id','languages','{name} - {language_short_key} ({id})', null, 'name');

Reading the log file I found this

Query error: Column 'name' in where clause is ambiguous - Invalid query: SELECT `formats`.*, CONCAT('', COALESCE(j1cfe157f.unit_of_measure, ''), ' (', COALESCE(j1cfe157f.id, ''), ')') as s1cfe157f, CONCAT('', COALESCE(jd21dc9dc.name, ''), ' - ', COALESCE(jd21dc9dc.language_short_key, ''), ' (', COALESCE(jd21dc9dc.id, ''), ')') as sd21dc9dc
FROM `formats`
LEFT JOIN `units_of_measure` as `j1cfe157f` ON `j1cfe157f`.`id` = `formats`.`units_of_measure_id`
LEFT JOIN `languages` as `jd21dc9dc` ON `jd21dc9dc`.`id` = `formats`.`languages_id`
WHERE `name` LIKE '%rectal%' ESCAPE '!'
 LIMIT 10

The problem is clearly on the column “name” since both formats and languages have a column called “name”. The WHERE clause should have been generated preponing the main table name as in ‘formats.name’ . Anaone experienced the same trouble? is it possible to have a fixing? Thanks.

Hello
You don’t say you use the same field name
and you tried in the where
this was a quick look

WHERE formats.name LIKE ‘%rectal%’ ESCAPE ‘!’

I do not create the query, GroceryCrud does it for us. Do you mean there are some grocery crud functions I should use or use differently to avoid the problem? Because for sure I cannot change manually the query itself. Thanks.

Hey guys, any ideas?

May I ask to GC guys to give a look to this use case to check if there is a bug in the query creation? Thank you.

Hello @fede72bari , from what I understood you are referring to Grocery CRUD version 1 right? Are you using the latest version? I remember we had similar issues but are resolved at the latest version (e.g. 1.6.4)

Can you please provide us which version are you using?

Regards
Johnny