[Tickets #9680] Unexpected return value in /framework/Core/lib/Horde/Core/Tree/Javascript.php
bugs at horde.org
bugs at horde.org
Fri Mar 18 16:48:38 UTC 2011
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.
Ticket URL: http://bugs.horde.org/ticket/9680
------------------------------------------------------------------------------
Ticket | 9680
Created By | Gunnar Wrobel <wrobel at pardus.de>
Summary | Unexpected return value in
| /framework/Core/lib/Horde/Core/Tree/Javascript.php
Queue | Horde Framework Packages
Version | Git master
Type | Bug
State | Unconfirmed
Priority | 1. Low
Milestone |
Patch |
Owners |
------------------------------------------------------------------------------
Gunnar Wrobel <wrobel at pardus.de> (2011-03-18 16:48) wrote:
I frequently see the following stack trace in my git install:
HORDE [horde] PHP ERROR: array_keys() [<a
href='function.array-keys'>function.array-keys</a>]: The first
argument should be an
array [pid 10039 on line 50 of
"/framework/Core/lib/Horde/Core/Tree/Javascript.php"]
Mar 18 17:31:49 temple HORDE:
1. Horde::menu() /horde/services/portal/index.php:56
#0122. require() /framework/Core/lib/Horde.php:2164
#0123. require() /horde/templates/menu/menu.inc:4
#0124. Horde_Core_Sidebar->getTree() /horde/services/sidebar.php:27
#0125. Horde_Core_Factory_Tree->create()
/framework/Core/lib/Horde/Core/Sidebar.php:127
#0126. Horde_Tree::factory()
/framework/Core/lib/Horde/Core/Factory/Tree.php:79
#0127. Horde_Core_Tree_Javascript->__construct()
/framework/Tree/lib/Horde/Tree.php:53
#0128. array_keys() /framework/Core/lib/Horde/Core/Tree/Javascript.php:50
#0129. Horde::errorHandler()
This fixes the issue for me
diff --git a/framework/Core/lib/Horde/Core/Tree/Javascript.php
b/framework/Core/lib/Horde/Core/Tree/Javascript.php
index b8ebb78..66eaace 100644
--- a/framework/Core/lib/Horde/Core/Tree/Javascript.php
+++ b/framework/Core/lib/Horde/Core/Tree/Javascript.php
@@ -37,6 +37,9 @@ class Horde_Core_Tree_Javascript extends
Horde_Core_Tree_Html
isset($_COOKIE[$this->_instance . '_expanded'])) {
/* Get current session expanded values. */
$curr = call_user_func($session['get'], $this->_instance, '');
+ if (empty($curr)) {
+ $curr = array();
+ }
/* Remove "exp" prefix from cookie value. */
$exp = explode(',', substr($_COOKIE[$this->_instance .
'_expanded'], 3));
.. but I do not assume this is the correct fix.
More information about the bugs
mailing list