Skip to content

Commit

Permalink
Use default values while validating user backend
Browse files Browse the repository at this point in the history
refs #12295
  • Loading branch information
N-o-X committed Dec 20, 2016
1 parent 23f7544 commit 69eaaec
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion application/forms/Config/UserBackendConfigForm.php
Expand Up @@ -354,7 +354,14 @@ public function isValid($formData)
*/
public static function inspectUserBackend(Form $form)
{
$backend = UserBackend::create(null, new ConfigObject($form->getValues()));
$values = array_filter($form->getValues(),
function($v) {
if ($v || $v === 0 || $v === '0') {
return $v;
}
}
);
$backend = UserBackend::create(null, new ConfigObject($values));
if ($backend instanceof Inspectable) {
return $backend->inspect();
}
Expand Down

0 comments on commit 69eaaec

Please sign in to comment.