Laravel-Backpack / PermissionManager

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

Datatables error in "roles" if no "permissions" added #97

Closed V1TA5 closed 6 years ago

V1TA5 commented 7 years ago

Hi, i got the error DataTables warning: table id=crudTable - Ajax error. when i opened "roles" until i added my first permission in "permissions". The Error wont show up again after deleting that permission and having none again.

Im using Laravel 5.4 (fresh install), ubuntu 16 LTS, mariadb and followed the installation instructions.

lloy0076 commented 7 years ago

There should be some sort of exception in storage/logs/laravel.log which would explain the error - if you can find it, could you share it with us?

candro commented 7 years ago

This error occurs when the version of "spatie / laravel-permission" differs from "^ 1.4".

ErrorExeption:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'myTableName.model_has_roles' doesn't exist (SQL: select roles.*, model_has_roles.model_id as pivot_model_id, model_has_roles.role_id as pivot_role_id from roles inner join model_has_roles on roles.id = model_has_roles.role_id where model_has_roles.model_id = 1 and model_has_roles.model_type = App\User) (View: ...my_path...\crud\columns\select_multiple.blade.php)

lloy0076 commented 7 years ago

There is another issue where something like this has occurred - specifically if spatie/laravel-permission stomps over backpack changes and everything goes downhill there...it's possibly what you're seeing.

jagoanmamah commented 6 years ago

i have same problem

tabacitu commented 6 years ago

Hmm... I just checked, with laravel-permission v1.16.0, and it worked for me, no error....

tabacitu commented 6 years ago

Let's close the issue for now, since I can't reproduce it. But if someone else gets this, please reopen or comment. Or both :-)