Check if acls is populated before doing foreach
This commit is contained in:
parent
d8e8b94119
commit
b198848a47
1 changed files with 12 additions and 4 deletions
|
|
@ -159,10 +159,14 @@ class RoleController extends BaseController
|
|||
|
||||
// acl attributes
|
||||
$acl_attribs = $req->request->get('acl');
|
||||
|
||||
if (!empty($acl_attribs))
|
||||
{
|
||||
foreach ($acl_attribs as $acl_key)
|
||||
{
|
||||
$row->addACLAccess($acl_key);
|
||||
}
|
||||
}
|
||||
|
||||
// validate
|
||||
$errors = $validator->validate($row);
|
||||
|
|
@ -240,11 +244,15 @@ class RoleController extends BaseController
|
|||
|
||||
// then add
|
||||
$acl_attribs = $req->request->get('acl');
|
||||
|
||||
if (!empty($acl_attribs))
|
||||
{
|
||||
foreach ($acl_attribs as $acl_key)
|
||||
{
|
||||
$row->addACLAccess($acl_key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// validate
|
||||
$errors = $validator->validate($row);
|
||||
|
|
|
|||
Loading…
Reference in a new issue