role/audit: Pre-populate backend name with the first one found
Otherwise a user who doesn't use a suggestion will see an error.
This commit is contained in:
parent
5b970c79ad
commit
d49962ac82
|
@ -151,8 +151,15 @@ class RoleController extends AuthBackendController
|
|||
$name = $this->params->get($type);
|
||||
|
||||
$backend = null;
|
||||
if ($name && $type === 'user') {
|
||||
$backend = $this->params->getRequired('backend');
|
||||
if ($type === 'user') {
|
||||
if ($name) {
|
||||
$backend = $this->params->getRequired('backend');
|
||||
} else {
|
||||
$backends = $this->loadUserBackends();
|
||||
if (! empty($backends)) {
|
||||
$backend = array_shift($backends)->getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$form = new SingleValueSearchControl();
|
||||
|
|
Loading…
Reference in New Issue