6.0.0-beta1
7/19/25

[#3747] Wrong array variable
Summary Wrong array variable
Queue Horde Framework Packages
Queue Version FRAMEWORK_3
Type Bug
State Not A Bug
Priority 2. Medium
Owners
Requester stephen.cuppett (at) webmastersinc (dot) net
Created 04/08/2006 (7042 days ago)
Due
Updated 07/29/2008 (6199 days ago)
Assigned 04/08/2006 (7042 days ago)
Resolved 04/21/2006 (7029 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
07/29/2008 08:58:11 AM y_knight (at) hotmail (dot) com Comment #9 Reply to this comment
i have the below error on my plesk and i like some body to help me how 
to solve it





  The following code in lib/Horde/DataTree.php is incorrect:

[Show Quoted Text - 23 lines]
04/21/2006 07:23:52 PM Chuck Hagenbuch State ⇒ Not A Bug
 
04/21/2006 07:20:24 PM stephen (dot) cuppett (at) webmastersinc (dot) net Comment #8 Reply to this comment
This has been resolved as to an outdated internal version of PEAR DB 
distributed with Plesk's Horde system.



Here is the link to the forum append at Plesk's site with the resolution:



http://forum.swsoft.com/showthread.php?s=36d8ca0dbf1a012cf1e2d23d6d42578a&threadid=32922&highlight=Horde
04/11/2006 05:37:07 PM stephen (dot) cuppett (at) webmastersinc (dot) net Comment #7 Reply to this comment
Will be setting this up with PHP5 and base packages as distributed of 
Horde and IMP.  Will generate a diff of this and the Plesk version and 
see if I can resolve it.  Will post back here with results.
04/09/2006 04:38:47 PM Chuck Hagenbuch Comment #6 Reply to this comment
Plesk is a potential problem - they seem to muck with Horde a lot, 
they don't contribute anything back to us, and they do a horrible job 
of supporting their users.



I'm running PHP 5 on my site and not seeing any of these errors, So 
you're going to need to do a little digging to figure out where the 
problem is coming from.
04/09/2006 01:51:08 PM stephen (dot) cuppett (at) webmastersinc (dot) net Comment #5 Reply to this comment
No, this is stock RHEL3 running Plesk with their provided horde and 
imp packages.  I had updated to PHP5 and different parts of the 
program have started to fail with these types of errors:



[Sun Apr 09 09:47:59 2006] [error] [client 24.211.148.149] PHP Fatal 
error:  Cannot use object of type DB_mysql as array in 
/usr/share/psa-horde/lib/Horde/DataTree/sql.php on line 997, referer: 
http://webmail.webmastersinc.net/services/portal/sidebar.php



I'm getting them on the Notes, Calendar, Address Book accompanied by a 
blank page.  The only thing that appears to work is the Inbox; 
however, I did have to make that cat -> cats adjustment in the 
aforementioned code piece to get the login and mail portions to come 
up due to a similar fatal error as quoted before.



I seem to have very recent versions:



psa-imp-4.1-rhel3.build80060331.13

psa-horde-3.1.1-rhel3.build80060331.13

php -v

PHP 5.1.2 (cli) (built: Mar  5 2006 17:16:08)

Copyright (c) 1997-2006 The PHP Group

Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
04/09/2006 01:44:30 PM Chuck Hagenbuch Comment #4 Reply to this comment
It is tested with php 5 and works well under normal conditions. 
However error conditions and edge cases still pop up now and then. If 
you're seeing problems in normal operation, something else may be 
going on. Are you using APC or another php accelerator?
04/09/2006 01:34:31 PM stephen (dot) cuppett (at) webmastersinc (dot) net Comment #3 Reply to this comment
Is the Horde framework tested with PHP5, or just PHP4?  I'm seeing 
other errors elsewhere in the framework that seems to stem from 
treating classes like arrays, which was okay with PHP4, but that now 
causes errors in PHP5.
04/08/2006 11:35:41 PM Chuck Hagenbuch Comment #2
State ⇒ Feedback
Priority ⇒ 2. Medium
Reply to this comment
The following code in lib/Horde/DataTree.php is incorrect:
I don't think so. This error doesn't appear for any developer and 
isn't reported by anyone else.
It creates the array cats, but then proceeds to use "cat" for the
rest of the code.  This causes the PHP fatal error:
$cats is unused, true, but $cat is defined every time through the 
foreach loop and is correct.
04/08/2006 06:51:13 PM stephen (dot) cuppett (at) webmastersinc (dot) net Comment #1
Priority ⇒ 3. High
Type ⇒ Bug
Summary ⇒ Wrong array variable
Queue ⇒ Horde Framework Packages
State ⇒ Unconfirmed
Reply to this comment
The following code in lib/Horde/DataTree.php is incorrect:



     function set($data, $charset = null)

     {

         $cats = array();

         $cids = array();

         foreach ($data as $id => $cat) {

             if (!is_null($charset)) {

                 $cat[1] = String::convertCharset($cat[1], $charset);

             }

             $cids[$cat[0]] = $cat[1];

             $cparents[$cat[0]] = $cat[2];

             $corders[$cat[0]] = $cat[3];

             $sorders[$cat[0]] = $id;

         }



It creates the array cats, but then proceeds to use "cat" for the rest 
of the code.  This causes the PHP fatal error:



PHP Fatal error:  Cannot use object of type DB_mysql as array in 
/usr/share/psa-horde/lib/Horde/DataTree.php on line 657.



This problem exists in 3.1.1


Saved Queries