Merge branch 'bugfix/Fix-DashboardController-code-9003'

This commit is contained in:
Eric Lippmann 2015-11-23 10:21:13 +01:00
commit 6725d6fa9d
1 changed files with 2 additions and 10 deletions

View File

@ -169,17 +169,13 @@ class DashboardController extends ActionController
try { try {
$dashboardConfig->saveIni(); $dashboardConfig->saveIni();
Notification::success(t('Dashlet has been removed from') . ' ' . $pane->getTitle()); Notification::success(t('Dashlet has been removed from') . ' ' . $pane->getTitle());
return true;
} catch (Exception $e) { } catch (Exception $e) {
$action->view->error = $e; $action->view->error = $e;
$action->view->config = $dashboardConfig; $action->view->config = $dashboardConfig;
$action->render('error'); $action->render('error');
return false; return false;
} catch (ProgrammingError $e) {
Notification::error($e->getMessage());
return false;
} }
return false; return true;
}); });
$form->setTitle($this->translate('Remove Dashlet From Dashboard')); $form->setTitle($this->translate('Remove Dashlet From Dashboard'));
$form->setRedirectUrl('dashboard/settings'); $form->setRedirectUrl('dashboard/settings');
@ -209,17 +205,13 @@ class DashboardController extends ActionController
try { try {
$dashboardConfig->saveIni(); $dashboardConfig->saveIni();
Notification::success(t('Dashboard has been removed') . ': ' . $pane->getTitle()); Notification::success(t('Dashboard has been removed') . ': ' . $pane->getTitle());
return true;
} catch (Exception $e) { } catch (Exception $e) {
$action->view->error = $e; $action->view->error = $e;
$action->view->config = $dashboardConfig; $action->view->config = $dashboardConfig;
$action->render('error'); $action->render('error');
return false; return false;
} catch (ProgrammingError $e) {
Notification::error($e->getMessage());
return false;
} }
return false; return true;
}); });
$form->setTitle($this->translate('Remove Dashboard')); $form->setTitle($this->translate('Remove Dashboard'));
$form->setRedirectUrl('dashboard/settings'); $form->setRedirectUrl('dashboard/settings');