Download & Extend

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

Project:Duration
Version:6.x-1.0-rc2
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

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

#1

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

#2

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?

#3

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

Title change.

#4

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

#5

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.

#6

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.