From d22363d365301a0adc6c5829ef3a03d60bd099d5 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 10 Jul 2014 13:43:49 +0200 Subject: [PATCH] Fix error messages not being displayed in the preferences configuration --- application/controllers/PreferenceController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/controllers/PreferenceController.php b/application/controllers/PreferenceController.php index c3d2a9150..1055451db 100644 --- a/application/controllers/PreferenceController.php +++ b/application/controllers/PreferenceController.php @@ -32,6 +32,7 @@ use Icinga\Web\Widget\Tab; use Icinga\Application\Config as IcingaConfig; use Icinga\Web\Url; use Icinga\Form\Preference\GeneralForm; +use Icinga\Web\Notification; /** * Application wide preference controller for user preferences @@ -69,14 +70,14 @@ class PreferenceController extends BasePreferenceController if ($form->isSubmittedAndValid()) { try { $this->savePreferences($form->getPreferences()); - $this->view->successMessage = 'Preferences Updated Successfully'; + Notification::success(t('Preferences updated successfully')); // Recreate form to show new values // TODO(el): It must sufficient to call $form->populate(...) $form = new GeneralForm(); $form->setConfiguration(IcingaConfig::app()); $form->setRequest($this->getRequest()); } catch (Exception $e) { - $this->view->exceptionMessage = $e->getMessage(); + Notification::error(sprintf(t('Failed to persist preferences. (%s)'), $e->getMessage())); } } $this->view->form = $form;