Hello, I hope you are well.
Any option to not change all the names of the keys of the other tables?
Background:
- In all my tables the key is called id.
- It only shows me an error when filtering by the id of the main table.
- I use Bootstrap 5 theme.
Relations:
$crud->set_relation('cliente_id', 't_clientes', 'cliente_c');
$crud->set_relation('severity_id', 'tblseverities', 'severity');
$crud->set_relation('tenant_id', 'tbltenants', 'nombre');
$crud->set_relation('status_id', 'tblstatus', 'status');
$crud->set_relation('owner_id', 'users', 'username');
$crud->set_relation('lock_by', 'users', 'username');
$crud->set_relation('destinatarios_id', 't_destinatarios', 'nombre_destinatarios');
$crud->set_relation('responsable_id', 'tblresponsables', 'responsable');
Console error:
/index/ajax_list 500 (Internal Server Error)
Error in logs:
ERROR - 2022-09-27 18:18:31 --> Query error: Column 'id' in where clause is ambiguous - Invalid query: SELECT `tblluck`.*, j4a860110.cliente_c AS s4a860110, j4449c1fa.severity AS s4449c1fa, j38543614.nombre AS s38543614, jdc91ed4b.status AS sdc91ed4b, j5e7b1936.username AS s5e7b1936, j5e32d6d8.username AS s5e32d6d8, jac15c7d5.nombre_destinatarios AS sac15c7d5, j1ba06e10.responsable AS s1ba06e10
FROM `tblluck`
LEFT JOIN `t_clientes` as `j4a860110` ON `j4a860110`.`id_cliente` = `tblluck`.`cliente_id`
LEFT JOIN `tblseverities` as `j4449c1fa` ON `j4449c1fa`.`id` = `tblluck`.`severity_id`
LEFT JOIN `tbltenants` as `j38543614` ON `j38543614`.`id` = `tblluck`.`tenant_id`
LEFT JOIN `tblstatus` as `jdc91ed4b` ON `jdc91ed4b`.`id` = `tblluck`.`status_id`
LEFT JOIN `users` as `j5e7b1936` ON `j5e7b1936`.`id` = `tblluck`.`owner_id`
LEFT JOIN `users` as `j5e32d6d8` ON `j5e32d6d8`.`id` = `tblluck`.`lock_by`
LEFT JOIN `t_destinatarios` as `jac15c7d5` ON `jac15c7d5`.`id_destinatarios` = `tblluck`.`destinatarios_id`
LEFT JOIN `tblresponsables` as `j1ba06e10` ON `j1ba06e10`.`id` = `tblluck`.`responsable_id`
WHERE `id` LIKE '%5%' ESCAPE '!'
ORDER BY `updated_at` ASC
LIMIT 10