From: Gunnar Wrobel Date: Fri, 1 May 2009 14:22:27 +0000 (+0200) Subject: Errors in the Action form should not hide the main form. Refresh the object after... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=4d9a47748b0dac48ffa323613adfcb84a8438520;p=horde.git Errors in the Action form should not hide the main form. Refresh the object after an action. --- 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'); } }