When trying to create content I get this error:

Fatal error: Call to a member function on a non-object in /home/virtual/site1/fst/var/www/html/test/modules/duration/duration_element.module on line 58

any ideas on how to fix it?

Comments

farsout68’s picture

Sorry, I forgot to mention that I'm running Drupal 6.6

jpetso’s picture

Status: Active » Postponed (maintainer needs more info)

That would mean that the $duration variable does not contain an object, which is strange because there are two possible cases due to the if-condition that leads to line 58:

  • The first case ensures that $duration is an object. So that can't be it.
  • If $duration is not an object, duration_create() is called to assign a new Duration object to that variable. Which should in turn always return an object too, as can be seen at the top of duration.inc.

I have no idea how there can ever be a non-object for $duration on line 58. For the lack of other pointers... which PHP version are you using?

jpetso’s picture

Title: Error » Error: Call to a member function on a non-object

Title change.

farsout68’s picture

Sorry for the delayed response... the version of PHP is 4.3.11

jpetso’s picture

Status: Postponed (maintainer needs more info) » Active

PHP 4... ouch. With object handling completely reworked in PHP 5, I guess there's just some incompatibility there, and I don't intend to downgrade to PHP 4 just to support a PHP version that is already unsupported by upstream for nearly a year. If you can fix the cause of the error by yourself, I might be willing to incorporate your patch... otherwise, with PHP 4 as the suspected villain, this is a "won't fix". Sorry.

Leaving this issue open as a pointer to include a PHP 5 requirement in the info files.

farsout68’s picture

LOL, yeah... I figured the version of PHP would be a problem. I'm going to upgrade today and see what happens. Thanks for you help.