kishor10d / Admin-Panel-User-Management-using-CodeIgniter

Admin Panel User Management Demo - CodeIgniter + AdminLTE Theme
http://cias.codeinsect.com
GNU General Public License v3.0
334 stars 244 forks source link

Trying to get property 'access' of non-object #100

Closed mayankrajs24 closed 1 year ago

mayankrajs24 commented 1 year ago

I am getting This error on Online server but in local its working..

There are two errors 1)Trying to get property 'access' of non-object 2)Invalid argument supplied for foreach()

Untitled Untitlesd

kishor10d commented 1 year ago

@mayankrajs24 : It looks like you uploaded the code correctly but not the database. Please check that in your tbl_access_matrix, there is a field name access is present or not

mayankrajs24 commented 1 year ago

I have checked and Imported the table correctly. access is present

kishor10d commented 1 year ago

@mayankrajs24 Then check, which user you are trying to login, and you don't have data for him in that tbl_access_matrix. This is not the issue actually, still we can try to solve here. .

mayankrajs24 commented 1 year ago

Username : admin@example.com Pass : admin

kishor10d commented 1 year ago

@mayankrajs24 : I am not asking to confirm this. Please check record is there which is associated with admin user's roleId or not.

If you are unable to figure out, then execute below query on database, and then try login.

INSERT INTO `tbl_access_matrix` (`id`, `access`, `roleId`, `isDeleted`, `createdBy`, `createdDtm`, `updatedBy`, `updatedDtm`) VALUES (NULL, '[{\"module\":\"Task\",\"total_access\":0,\"list\":0,\"create_records\":0,\"edit_records\":0,\"delete_records\":0},{\"module\":\"Booking\",\"total_access\":0,\"list\":0,\"create_records\":0,\"edit_records\":0,\"delete_records\":0}]', '1', '0', '1', '2022-08-19 15:21:25', NULL, NULL);

kishor10d commented 1 year ago

@mayankrajs24 : Hi Mayank, I took this as bug, and now provided the fix. You can pull new master branch with the change. Or you can go with above mentioned query.