[kronolith] Call to a member function on a non-object

"Markus K. Schäffauer" Markus.K.Schaeffauer at gmx.de
Thu Feb 20 11:57:20 PST 2003


Hi,
finally someone with the same problem...
I posted severall questions about this in the kronolith newsgroup.
I, too, think it may be a problem of the MySQL database,
that I created in the same way as you.
I'll append you the only answer I got until today.
Eric seems to be sceptically about our suposition that MySQL is causing 
this.
He told me, that the factory-call has nothing to do with it.
I would apreciate to stay in contact with you for resolving this problem.
Bye,
Markus

Here the answer of Eric Rostetter:

Quoting "\"Markus K. Schäffauer\"" <Markus.K.Schaeffauer at gmx.de>:


>> Fatal error: Call to a member function on a non-object in
>> /opt/lampp/htdocs/horde/kronolith/lib/base.php on line 71
>  
>

Lines 70 and 71 read:

$GLOBALS['calendar'] = &Kronolith_Driver::factory($conf['calendar']['driver'],
$conf['calendar']['params']);
$GLOBALS['calendar']->open(Auth::getAuth());

So, it is failing in the second line.  The most reasonable reason for the
failure is that the first line failed for some reason. Unfortunately,
no check was made for the success or failure of the factory() call...

Even in CVS HEAD we don't seem to check the return value...  I'm not
expert, but this seems like a problem.  I would think we should make
some check, and report an error if the factory() call fails...

You might try changing the above to something like:

$GLOBALS['calendar'] = &Kronolith_Driver::factory($conf['calendar']['driver'],
$conf['calendar']['params']);
if ($GLOBALS['calendar'] === false) {
   Horde::fatal(new PEAR_Error(_("Couldn't create calendar instance")),
          __FILE__, __LINE__);
}
$GLOBALS['calendar']->open(Auth::getAuth());

That should tell you if the factory() call is failing or not.

[I got the message that, in fact, "Couldn't create calendar instance".]

>> As some of you suggest in the news, it seems to be a problem of the
>> config.php
>> of Kronolith, but I can not find anything wrong
>  
>

Try this, if you have a stand-alone php command: php -l conf.php
and see if it reports any problems  with the file's syntax.

[I tried this and got the message that there is no error with the conf.php of kronolith.]

>> - and I am still getting the
>> error message after login and when clicking on "Horde" or on "Kronolith".
>  
>

Yes, no doubt as Horde does a kronolith api call.

-- Eric Rostetter The Department of Physics The University of Texas at 
Austin Why get even? Get odd!



More information about the kronolith mailing list