From: Michael J. Rubinsky Date: Tue, 7 Dec 2010 15:51:55 +0000 (-0500) Subject: Fix deleting block directly from portal screen. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=a3a199f2db1eb14dc376afdd193cfb32f9f81bb8;p=horde.git Fix deleting block directly from portal screen. We can't pass the url to the Layout_Manager, or it will redirect before we save the layout pref again. Fixes Bug: 9421 --- diff --git a/framework/Block/lib/Horde/Block/Layout/Manager.php b/framework/Block/lib/Horde/Block/Layout/Manager.php index bf422816c..00475cc4a 100644 --- a/framework/Block/lib/Horde/Block/Layout/Manager.php +++ b/framework/Block/lib/Horde/Block/Layout/Manager.php @@ -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); diff --git a/horde/services/portal/edit.php b/horde/services/portal/edit.php index 2de9abf83..8541fff35 100644 --- a/horde/services/portal/edit.php +++ b/horde/services/portal/edit.php @@ -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");