Laravel-Backpack/PermissionManager

SQLSTATE[HY093]: Invalid parameter number

nordic-digit opened this issue · 3 comments

Bug report

I am getting this error when i am clicking on roles. permissions works fine. i can create new roles but i always get this error, when i am in the list view. even when i have complete empty roles table. here is the full error:

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` = ? and `users`.`deleted_at` is null) as `users_count` from `roles`) as `roles_aggregator`

i already tried to reinstall everything i tried it in a complete new laravel enviroment. nothing helped.

i am using laravel 9.11 with php 8.0.2 and backpack 5.0

Hello there! Thanks for opening your first issue on this repo!

Just a heads-up: Here at Backpack we use Github Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that.

Backpack communication mediums:

  • Bug Reports, Feature Requests - Github Issues (here);
  • Quick help (How do I do X) - Gitter Chatroom;
  • Long questions (I have done X and Y and it won't do Z wtf) - Stackoverflow, using the backpack-for-laravel tag;

Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch.

Thank you!

--
Justin Case
The Backpack Robot

Hi @nordic-digit ,

That's odd. Seems to be working well on my end - so it must be something on your machine, or some changes you've made. Maybe I can help you discover what:

  1. Just to confirm, you're getting this error when you enter the List operation of Roles... correct? So this page:

CleanShot 2023-04-13 at 16 03 24@2x

  1. The same page is working just fine in our demo, correct? https://demo.backpackforlaravel.com/admin/role

  2. Have you made any changes to your User, Role or Permission models (or dbs)?

  3. What are the exact versions you're using? Please copy-paste the output of php artisan backpack:version

Cheers!

pxpm commented

Hey guys!

Thanks for the report @nordic-digit !

We found out the issue you described in the Backpack\CRUD repository and fixed it there.

It should be working fine on 5.5.7 . Please do a composer update backpack/crud to get the latest version.

Cheers 🙏