/**
  * Edit an user group backend
  */
 public function editAction()
 {
     $backendName = $this->params->getRequired('backend');
     $form = new UserGroupBackendForm();
     $form->setRedirectUrl('config/userbackend');
     $form->setIniConfig(Config::app('groups'));
     $form->setOnSuccess(function (UserGroupBackendForm $form) use($backendName) {
         try {
             $form->edit($backendName, $form::transformEmptyValuesToNull($form->getValues()));
         } catch (Exception $e) {
             $form->error($e->getMessage());
             return false;
         }
         if ($form->save()) {
             Notification::success(sprintf(t('User group backend "%s" successfully updated'), $backendName));
             return true;
         }
         return false;
     });
     try {
         $form->load($backendName);
         $form->handleRequest();
     } catch (NotFoundError $_) {
         $this->httpNotFound(sprintf($this->translate('User group backend "%s" not found'), $backendName));
     }
     $this->renderForm($form, $this->translate('Update User Group Backend'));
 }
 /**
  * Edit an user group backend
  */
 public function editAction()
 {
     $backendName = $this->params->getRequired('backend');
     $form = new UserGroupBackendForm();
     $form->setRedirectUrl('usergroupbackend/list');
     $form->setTitle(sprintf($this->translate('Edit User Group Backend %s'), $backendName));
     $form->setIniConfig(Config::app('groups'));
     $form->setOnSuccess(function (UserGroupBackendForm $form) use($backendName) {
         try {
             $form->edit($backendName, array_map(function ($v) {
                 return $v !== '' ? $v : null;
             }, $form->getValues()));
         } catch (Exception $e) {
             $form->error($e->getMessage());
             return false;
         }
         if ($form->save()) {
             Notification::success(sprintf(t('User group backend "%s" successfully updated'), $backendName));
             return true;
         }
         return false;
     });
     try {
         $form->load($backendName);
         $form->handleRequest();
     } catch (NotFoundError $_) {
         $this->httpNotFound(sprintf($this->translate('User group backend "%s" not found'), $backendName));
     }
     $this->view->form = $form;
     $this->render('form');
 }