[horde] Category problems, undefined index.

Stephen Sherlock stevesherlock at es-net.co.uk
Thu Oct 24 15:03:55 PDT 2002


As promised, here's all the posts from the kronolith newsgroup for this 
thread. Hopefully it'll be more use to people here...

**************************************************************************

Category problems, undefined index.
From: Stephen Sherlock <stephen.sherlock at btinternet.com>
Date:Wednesday 23 Oct 2002 6:51:19 pm
Groups:gmane.comp.horde.kronolith

Hey all.

First off, I'm sorry if I've posted this in the wrong group, but I couldn't
find a general horde one and kronolith seems to be the module most affected
by this problem...

Anyway, I installed the latest CVS the other day (and have updated it
several times since). Any module that uses categories now gives me an
undefined index error or three at the top of the page (kronolith and nag
have both shown signs of this "bug"). The category system is set to php...

As far as I can see, the problem is with the category_parents data - the
line in question is referring to $cids[$parID], and the data int he mySQL
table points to an index that doesn't exist in the cids array.

The problem is generated from the import function within
/horde/lib/Category.php

If there is any more info you all need to help me troubleshoot, just ask and
I'll be glad to provide it.

Oh, one other thing - the horde.log doesn't show anything relevant to the
problem, and I pass all the tests on "test.php", except for one error to do
with File.php (within pear) that I've been told on IRC to ignore. Anywaits,
file.php can't have anything to do with categories now, can it? ;)

Thanks in advance,

Stephen Sherlock

-----     -----     -----     -----     -----


Re: Category problems, undefined index.
From: Kevin M. Myer <kevin_myer at iu13.org>
Date: Thursday 24 Oct 2002 2:09:45 pm
Groups: gmane.comp.horde.kronolith

I am seeing the same thing here.  My logs show the following everytime I 
access
kronolith, nag or mnemo:

[23-Oct-2002 12:46:37] PHP Notice:  Undefined index:  3708 in
/horde/lib/Category.php on line 468
[23-Oct-2002 12:46:37] PHP Notice:  Undefined index:  3710 in
/horde/lib/Category.php on line 468
[23-Oct-2002 12:46:37] PHP Notice:  Undefined index:  3712 in
/horde/lib/Category.php on line 468
[23-Oct-2002 12:46:37] PHP Notice:  Undefined index:  3723 in
/horde/lib/Category.php on line 468
[23-Oct-2002 12:46:37] PHP Notice:  Undefined index:  3725 in
/horde/lib/Category.php on line 468
[23-Oct-2002 12:46:37] PHP Notice:  Undefined index:  3727 in
/horde/lib/Category.php on line 468

So I guess its really a horde issue and the discussion should probably be 
moved
there.  I'm not subscribed there (yet anyway) so if someone else is, maybe 
you
could forward this along?  If not, I'll subscribe and add yet another 
mailing
list subscription to the repetoire.

Kevin

-----     -----     -----     -----     -----


Re: Category problems, undefined index.
From: Chuck Hagenbuch <chuck at horde.org>
Date: Thursday 24 Oct 2002 6:23:48 pm
Groups: gmane.comp.horde.kronolith

Looks like your SQL data is invalid somehow. If you back up your data and
start with an empty table, do the problems occur again?

-chuck

-----     -----     -----     -----     -----


Re: Category problems, undefined index.
From: Kevin M. Myer <kevin_myer at iu13.org>
Date: Thursday 24 Oct 2002 9:42:37 pm
Groups: gmane.comp.horde.kronolith

I dropped both horde_categories and kronolith_events and recreated them from 
the
sql scripts.  I had previously exported my calendar to icalendar format so I
imported that and I let horde_categories repopulate with whatever it wanted 
to.
 I'm still seeing the Undefined index messages.

Looking through the logs and the horde_categories and correlating what the 
logs
say are Undefined indexes and what horde_categories lists for those same 
index
numbers makes my head swim :)  But it looks like in all cases, the 
category_name
is "shares" and the category_parents is :1 (which I'm assuming is entry 1).

Entry 1 contains:
1,'horde.shares','kevin_myer at iu13.org','kronolith','','a:2:{s:11:\"share_owner\";s:19:\"kevin_myer at iu13.org\";s:10:\"share_name\";s:12:\"My
Task List\";}',6,20021024154602

There also appears to be 2 or 3 other entries which are identical except for 
the
date and id number.

Since I can't guarantee that it isn't a data issue, I think I'll pull a 
fresh
CVS checkout of HEAD and install on a different box and see if its still 
present
there.

I'll also look over the developer docs.  I'm not even sure what the 
Categories
do - I just know that without them, some stuff doesn't work :)

Kevin

-----     -----     -----     -----     -----


Re: Category problems, undefined index.
From: Stephen Sherlock <stevesherlock at es-net.co.uk>
Reply-To: stevesherlock at es-net.co.uk
Date: Thursday 24 Oct 2002 9:38:24 pm
Groups: gmane.comp.horde.kronolith

I've also put a few lines of debugging code into the "Calendar->import"
function, which seems to be the one giving me trouble.

The code now reads:

    function import($format, $data)
    {
        switch ($format) {
        case CATEGORY_FORMAT_FETCH:
echo "<br><br>Entered Switch:<br>";
            $cats = array();
            $cids = array();
            foreach ($data as $cat) {
                $cids[$cat[0]] = $cat[1];
                $cparents[$cat[0]] = $cat[2];
echo "cids[" . $cat[0] . "] = " . $cat[1] . " and cparents[" . $cat[0] . "]
= " . $cat[2] . "<br>";
            }
            foreach ($cids as $id => $name) {

... etc

And thus, the debugging printout (on the horde main page, with only the
kronolith summary displaying) looks like this:

Entered Switch:
cids[1] = kronolith and cparents[1] =
cids[2] = shares and cparents[2] = :1
cids[9] = ste and cparents[9] = :1:2


Entered Switch:
cids[3] = kronolith and cparents[3] =
cids[7] = ste and cparents[7] = :3:4
cids[10] = shares and cparents[10] = :3

Notice: Undefined index: 4 in /var/www/horde/lib/Category.php on line 470


Entered Switch:
cids[5] = kronolith and cparents[5] =
cids[8] = ste and cparents[8] = :5:6
cids[11] = shares and cparents[11] = :5

 Notice: Undefined index: 6 in /var/www/horde/lib/Category.php on line 470


Remember, this was a completely clean install from CVS HEAD, all fresh
database and everything. Since I'm only interested in relatively small
installs for the time being, would a temporary fix include getting the
function that calls this import function to pass the whole of the category
table in with the "$data" variable, or would that overload the server
beyond belief? I've not played with categories in a production system yet,
so I've no idea how big that table can get...

Thanks for any advice,

Stephen Sherlock




More information about the horde mailing list