Skip to content

Commit

Permalink
UsergroupbackendController: Do not persist empty configuration values
Browse files Browse the repository at this point in the history
refs #7343
  • Loading branch information
Johannes Meyer committed Jun 5, 2015
1 parent e9e97cb commit e6837cf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions application/controllers/UsergroupbackendController.php
Expand Up @@ -52,7 +52,7 @@ public function createAction()
$form->setIniConfig(Config::app('groups'));
$form->setOnSuccess(function (UserGroupBackendForm $form) {
try {
$form->add($form->getValues());
$form->add(array_filter($form->getValues()));
} catch (Exception $e) {
$form->error($e->getMessage());
return false;
Expand Down Expand Up @@ -85,7 +85,12 @@ public function editAction()
$form->setIniConfig(Config::app('groups'));
$form->setOnSuccess(function (UserGroupBackendForm $form) use ($backendName) {
try {
$form->edit($backendName, $form->getValues());
$form->edit($backendName, array_map(
function ($v) {
return $v !== '' ? $v : null;
},
$form->getValues()
));
} catch (Exception $e) {
$form->error($e->getMessage());
return false;
Expand Down

0 comments on commit e6837cf

Please sign in to comment.