agungsugiarto / boilerplate

CodeIgniter4 Boilerplate based on AdminLTE 3 with user management, roles, permissions, ...
MIT License
158 stars 49 forks source link

DataTables error on users #74

Closed InsiteFX closed 3 years ago

InsiteFX commented 3 years ago

Ok, this is weird, I did a new clean install and now I' am getting an error on viewing users.

ERROR: DataTables warning: table id=table-user - Ajax error. For more information about this error, please see http://datatables.net/tn/7

Funny thing is that it loads and views the menu just fine.

I checked the database and all info is there for both users.

Boilerplate latest version.

CodeIgniter 4 latest Development version

Windows 10 Pro x64 XAMPP 7.4.11

agungsugiarto commented 3 years ago

Can you give me more info specific for this error? Like debug console on chrome. You can read how to debug with the click link your mention.

daemonzone commented 3 years ago

I have the same issue:

This is from the Console:

Failed to load resource: the server responded with a status of 500 (Internal Server Error) http://localhost:8080/admin/user/manage?draw=1&columns%5B0%5D%5Bdata%5D=&columns%5B0%5D%5Bname%5D=&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=false&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=username&columns%5B1%5D%5Bname%5D=&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=email&columns%5B2%5D%5Bname%5D=&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B3%5D%5Bdata%5D=function&columns%5B3%5D%5Bname%5D=&columns%5B3%5D%5Bsearchable%5D=true&columns%5B3%5D%5Borderable%5D=false&columns%5B3%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B3%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B4%5D%5Bdata%5D=created_at&columns%5B4%5D%5Bname%5D=&columns%5B4%5D%5Bsearchable%5D=true&columns%5B4%5D%5Borderable%5D=true&columns%5B4%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B4%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B5%5D%5Bdata%5D=function&columns%5B5%5D%5Bname%5D=&columns%5B5%5D%5Bsearchable%5D=true&columns%5B5%5D%5Borderable%5D=false&columns%5B5%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B5%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=1&order%5B0%5D%5Bdir%5D=asc&start=0&length=10&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1604497237303

Screen Shot 2020-11-04 at 14 40 39

daemonzone commented 3 years ago

Maybe this could help a little more:

code: 500 file: "/var/www/htdocs/ci4/vendor/agungsugiarto/boilerplate/src/Controllers/Users/UserController.php" line: 38 message: "Undefined index: "

agungsugiarto commented 3 years ago

@daemonzone thanks, i will take a look.

daemonzone commented 3 years ago

@daemonzone thanks, i will take a look.

If it could be of any help...

Getting this message while debugging: "message": "Call to undefined method Myth\Auth\Authorization\UserModel::getResource",

I solved moving the "getResource(string $search = '')" function from agungsugiarto\boilerplate\Models\UserModel.php to vendor/myth/auth/src/Models/UserModel.php

agungsugiarto commented 3 years ago

Oke guys @InsiteFX @daemonzone this error come from helper model() on CodeIgniter4 development. The error says CRITICAL - 2020-11-04 09:02:45 --> Call to undefined method Myth\Auth\Models\UserModel::getResource this will call method on parent class not in childs class i dont know why. For now i will change and not using this helper.

daemonzone commented 3 years ago

Yeah, it looks like CI4 has issues finding the right object

I tried renaming your package UserModel to AdminUserModel and the model() helper works correctly, as well as the getResources() function call is using the method from the right class

agungsugiarto commented 3 years ago

@daemonzone i am lot of update not just fix this issue, can you test it before i am release? you can test from demo https://boilerplate-codeigniter4.herokuapp.com/

daemonzone commented 3 years ago

Yes, mate! Just tested the last version from this repo and it works correctly! Thanks so much! :-)