You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Model Parcours (id, cadre_id, date)
Model Cadre (id, name)
In the BREAD, Parcours has relationship belongsTo Cadre and display Cadre name
In the Parcours list view, the column Cadre is sortable.
But the search field goes to this error :
SQLSTATE[42S22]: Column not found: 1054 Field 'parcours.parcour_belongsto_cadre_relationship' unknown in where clause
select count(*) as aggregate from `parcours` left join `cadres` as `joined` on `parcours`.`cadre_id` = `joined`.`id` where `parcours`.`parcour_belongsto_cadre_relationship` LIKE %NAME% and `parcours`.`deleted_at` is null
Expected behavior
The SQL Query must be
select count(*) as aggregate from parcoursleft joincadresasjoinedonparcours.cadre_id=joined.idwherecadre.nameLIKE %NAME% andparcours.deleted_at is null
I put same name for cadre_id and Cadre relationship.
I check the cadre_id browse.
I uncheck the Cadre browse
The search is OK.
But it's the cadre_id which is displayed.
I want the cadre'name
Next I check the Cadre browse
The search is OK, it's the Cadre name which is displayed.
But there is both Cadre in the select dropdown search field, one for cadre_id, the other for Cadre relationship
Additional context
No response
The text was updated successfully, but these errors were encountered:
Did anyone find exact solution to this ? @Walt2018 your code will only work for specific browse file, what happens if it is showing in all the filters wherever we created a relationships in BREAD ? we can't make custom browse files for each module.
Laravel version
9.7.0
PHP version
8.1.4
Voyager version
1.5
Database
MySQL 8.0.28
Description
Search on relationship with serverside pagination
Steps to reproduce
Model Parcours (id, cadre_id, date)
Model Cadre (id, name)
In the BREAD, Parcours has relationship belongsTo Cadre and display Cadre name
In the Parcours list view, the column Cadre is sortable.
But the search field goes to this error :
Expected behavior
The SQL Query must be
select count(*) as aggregate from
parcoursleft join
cadresas
joinedon
parcours.
cadre_id=
joined.
idwhere
cadre.
nameLIKE %NAME% and
parcours.
deleted_atis null
Screenshots
None of theses fixes work for me :
#5635
#5449
#5412
#5312
#5245
#5185
#3595
I put same name for cadre_id and Cadre relationship.
I check the cadre_id browse.
I uncheck the Cadre browse
The search is OK.
But it's the cadre_id which is displayed.
I want the cadre'name
Next I check the Cadre browse
The search is OK, it's the Cadre name which is displayed.
But there is both Cadre in the select dropdown search field, one for cadre_id, the other for Cadre relationship
Additional context
No response
The text was updated successfully, but these errors were encountered: