Laravel-Backpack / PermissionManager

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

SQLSTATE[HY093]: Invalid parameter number #324

Closed nordic-digit closed 1 year ago

nordic-digit commented 1 year ago

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

welcome[bot] commented 1 year ago

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:

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

tabacitu commented 1 year ago

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
  2. The same page is working just fine in our demo, correct? https://demo.backpackforlaravel.com/admin/role

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

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

Cheers!

pxpm commented 1 year ago

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 🙏