From 4d9a47748b0dac48ffa323613adfcb84a8438520 Mon Sep 17 00:00:00 2001 From: Gunnar Wrobel Date: Fri, 1 May 2009 16:22:27 +0200 Subject: [PATCH] Errors in the Action form should not hide the main form. Refresh the object after an action. --- koward/lib/Koward/Controller/ObjectController.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/koward/lib/Koward/Controller/ObjectController.php b/koward/lib/Koward/Controller/ObjectController.php index 04f9eff1e..1157b1714 100644 --- a/koward/lib/Koward/Controller/ObjectController.php +++ b/koward/lib/Koward/Controller/ObjectController.php @@ -129,14 +129,23 @@ class ObjectController extends Koward_Controller_Application $actions = $this->object->getActions(); if (!empty($actions)) { - $this->actions = new Koward_Form_Actions($this->object); + try { + $this->actions = new Koward_Form_Actions($this->object); - $this->post = $this->urlFor(array('controller' => 'object', + $this->post = $this->urlFor(array('controller' => 'object', 'action' => 'view', 'id' => $this->params->id)); - if ($this->actions->validate()) { - $this->actions->execute(); + if ($this->actions->validate()) { + $this->actions->execute(); + + /** Reload the object */ + $this->object = $this->koward->getObject($this->params->id); + $actions = $this->object->getActions(); + $this->actions = new Koward_Form_Actions($this->object); + } + } catch (Exception $e) { + $this->koward->notification->push($e->getMessage(), 'horde.error'); } } -- 2.11.0