Laravel-Backpack / PermissionManager

Admin interface for managing users, roles, permissions, using Backpack CRUD
http://backpackforlaravel.com
Other
527 stars 168 forks source link

Role CRUD's List Operation Stopped working. #317

Closed karandatwani92 closed 1 year ago

karandatwani92 commented 1 year ago

Bug report

Role CRUD's List Operation Not working any more.

SQLSTATE[HY093]: Invalid parameter number (SQL: select count(*) as total_rows from (select `roles`.`id`, (select count(*) from `users` inner join `model_has_roles` on `users`.`id` = `model_has_roles`.`model_id` where `roles`.`id` = `model_has_roles`.`role_id` and `model_has_roles`.`model_type` = ?) as `users_count` from `roles`) as `roles_aggregator`)

Same Error on BackpackDemo: https://demo.backpackforlaravel.com/admin/role

JordanchoEftimov commented 1 year ago

Facing the same issue as well. Really annoying...

P.S. I managed to make it work by commenting this line:

$this->crud->query->withCount('users');

inside the List operation in the vendor folder, but that's not the proper solution.

pxpm commented 1 year ago

Hello guys, thanks for the report.

That should be fixed in Backpack/CRUD 5.4.11 https://github.com/Laravel-Backpack/CRUD/releases/tag/5.4.11

Please do a composer show backpack/crud and make sure you have atleast that version. If not, please update.

I just confirmed and it's fixed on the master branch: image

Let me know if I missed something 🙏

Wish you guys the best 🎅

tabacitu commented 1 year ago

Ouch! Didn't know that was happening. Crisis averted:

Thanks for the heads-up @karandatwani92 , and for pinpointing the issue @JordanchoEftimov .