diff --git a/src/Controller/UsersController.php b/src/Controller/UsersController.php index d33490c..574d344 100644 --- a/src/Controller/UsersController.php +++ b/src/Controller/UsersController.php @@ -74,10 +74,11 @@ class UsersController extends AppController } else { $validRoles = $this->Users->Roles->find('list')->order(['name' => 'asc'])->all()->toArray(); } - $defaultRole = $this->Users->Roles->find()->select(['id'])->where(['is_default' => true])->first()->toArray(); + $defaultRole = $this->Users->Roles->find()->select(['id'])->where(['is_default' => true])->first(); if (empty($defaultRole)) { - $defaultRole = $this->Users->Roles->find()->select(['id'])->first()->toArray(); + $defaultRole = $this->Users->Roles->find()->select(['id'])->first(); } + $defaultRole = $defaultRole->toArray(); $individuals = $this->Users->Individuals->find('list', $individuals_params)->toArray(); $this->CRUD->add([ 'beforeMarshal' => function($data) {