Display a page not found when the data is not in the dabase anymore

This commit is contained in:
Frédéric Guillot
2014-02-24 19:07:25 -05:00
parent 8159cc99a6
commit 565290fbf9
9 changed files with 70 additions and 9 deletions

View File

@@ -88,6 +88,11 @@ class Project extends Base
$project = $this->project->get($this->request->getIntegerParam('project_id'));
if (! $project) {
$this->session->flashError(t('Project not found.'));
$this->response->redirect('?controller=project');
}
$this->response->html($this->template->layout('project_edit', array(
'errors' => array(),
'values' => $project,
@@ -128,8 +133,15 @@ class Project extends Base
{
$this->checkPermissions();
$project = $this->project->get($this->request->getIntegerParam('project_id'));
if (! $project) {
$this->session->flashError(t('Project not found.'));
$this->response->redirect('?controller=project');
}
$this->response->html($this->template->layout('project_remove', array(
'project' => $this->project->get($this->request->getIntegerParam('project_id')),
'project' => $project,
'menu' => 'projects',
'title' => t('Remove project')
)));