Fix deleting block directly from portal screen.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Tue, 7 Dec 2010 15:51:55 +0000 (10:51 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Wed, 8 Dec 2010 02:56:28 +0000 (21:56 -0500)
We can't pass the url to the Layout_Manager, or it will redirect
before we save the layout pref again.

Fixes Bug: 9421

framework/Block/lib/Horde/Block/Layout/Manager.php
horde/services/portal/edit.php

index bf42281..00475cc 100644 (file)
@@ -215,7 +215,7 @@ class Horde_Block_Layout_Manager extends Horde_Block_Layout
         case 'shrinkDown':
         case 'removeBlock':
             try {
-                $result = call_user_func(array($this, $action), $row, $col);
+                call_user_func(array($this, $action), $row, $col);
                 $this->_updated = true;
             } catch (Horde_Exception $e) {
                 $GLOBALS['notification']->push($e);
index 2de9abf..8541fff 100644 (file)
@@ -22,15 +22,20 @@ if (!is_array($layout_pref)) {
 if (!count($layout_pref)) {
     $layout_pref = Horde_Block_Collection::getFixedBlocks();
 }
+
 $layout = Horde_Block_Layout_Manager::singleton('portal', $blocks, $layout_pref);
 
 // Handle requested actions.
 $layout->handle(Horde_Util::getFormData('action'),
                 (int)Horde_Util::getFormData('row'),
-                (int)Horde_Util::getFormData('col'),
-                Horde_Util::getFormData('url'));
+                (int)Horde_Util::getFormData('col'));
+
 if ($layout->updated()) {
     $prefs->setValue('portal_layout', $layout->serialize());
+    if (Horde_Util::getFormData('url')) {
+        $url = new Horde_Url(Horde_Util::getFormData('url'));
+        $url->unique()->redirect();
+    }
 }
 
 $title = _("My Portal Layout");