Errors in the Action form should not hide the main form. Refresh the object after...
authorGunnar Wrobel <p@rdus.de>
Fri, 1 May 2009 14:22:27 +0000 (16:22 +0200)
committerGunnar Wrobel <p@rdus.de>
Fri, 1 May 2009 14:22:27 +0000 (16:22 +0200)
koward/lib/Koward/Controller/ObjectController.php

index 04f9eff..1157b17 100644 (file)
@@ -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');
                     }
                 }