[hermes] Re: hermes Digest, Vol 109, Issue 1
Brian Nunes
jesus at frindar.com
Mon Feb 28 12:08:18 PST 2005
> ------------------------------
>
> Message: 3
> Date: Mon, 28 Feb 2005 13:03:46 -0600
> From: Brian Nunes <bnunes at frindar.com>
> Subject: [hermes] Undefined function
> To: hermes at lists.horde.org
> Message-ID: <200502281303.46905.bnunes at frindar.com>
> Content-Type: text/plain; charset="us-ascii"
>
> Hi,
> I am using a Redhat9 machine with Horde3.0 and Apache2.0 with PHP4.3
> installed. I have installed Hermes 0.1and am having problems with the Time
> Entry portion. Everything except the Time Entry works. When I click on it I
> get:
> *Date
> Fatal error: Cannot instantiate non-existent class: date in
> /www/htdocs/horde/lib/Horde/Form.php on line 2703
>
> Now, this *was* the function it's referring to:
> function &getDateOb($date_in)
> {
> require_once 'Date.php';
>
> if (is_array($date_in)) {
> /* If passed an array change it to the ISO format. */
> if ($this->emptyDateArray($date_in) == 0) {
> $date_in = sprintf('%04d-%02d-%02d 00:00:00',
> $date_in['year'], $date_in['month'], $date_in['day']);
> }
> } elseif (preg_match('/^\d{4}-\d{2}-\d{2}$/', $date_in)) {
> /* Fix the date if it is the shortened ISO. */
> $date_in = $date_in . ' 00:00:00';
> }
>
> /* Return the PEAR date object. */
> return $d = &new Date($date_in); /* THIS IS LINE 2703 */
> }
>
> But I changed the "require_once" statement to:
> require_once('/usr/local/lib/php/Date.php');
>
> And after I did this, the error changed to:
> *Date
> Fatal error: Call to undefined function: setdate() in
> /usr/local/lib/php/Date.php on line 176
>
> I have the Date module installed and all the permissions are correct
> (unless there are some strange permission settings I don't know about, but
> its owned by apache). I have been reading up on PHP and everything seems to
> be compatible with PHP4.3, but I CANNOT understand why it would not
> register the setDate() function, because it is clearly defined in Date.php.
>
> Can ANYONE offer any assitance, of ANY kind? Am I looking at a Horde code
> problem or a PHP library problem? Any advice would be greatly appreciated
> for this most exasperating of conundrums.
> Thanks,
> Brian
>
>
> ------------------------------
Hello again,
As an update to my situation, I have gotten the Time Entry FORM to come up
by changing the following lines in the getDateOb() function in Form.php:
....
/* Return the PEAR date object. */
return $d = &new Date(null); /* CHANGED FROM Date($date_in) */
}
....
And the following lines from Date() in Date.php:
function Date($date)
{
$this->tz = Date_TimeZone::getDefault();
if (is_null($date)) {
$this->setDate(date("Y-m-d H:i:s"));
} elseif (is_a($date, 'Date')) {
$this->copy($date);
} else {
$this->date = setDate($date,"DATE_FORMAT_ISO"); /* CHANGED FROM
setDate($date); */
}
}
And this got the Time Entry form to Come up. But when I try and enter a time
for a specified Job Type, I get the same:
Fatal error: Call to undefined function: setdate() in
/usr/local/lib/php/Date.php on line 137
So it appears I need to find another instance of setDate() being called
indirectly from something that entry.php is referencing. But rather than
trace setDate() to every indirect reference it has, I thought somenoe might
be able to help out a bit. Jan, is there anything you can tell me about this?
It looks like setDate() is just being called with the wrong parameters for
some reason. If I could find every instance of it I would gladly patch it up
and offer the patches for people who are having this same problem. But just a
*little* help? Pretty please?
-Brian
More information about the hermes
mailing list