Display method not defined for question.

Display method not defined for question.

by Ryan Dorcey -
Number of replies: 12
Was getting this error with version 2006021401 under PHP 5 when I attempted to preview or take a survey. Looks like it's caused by the fake questionnaire_question constructor in questiontypes.class.php. I modified it from:

function __construct() {
    $this->questionnaire_question($id = 0);
}

to this:

function __construct($id = 0, $question = null) {
    $this->questionnaire_question($id, $question);
}

Fixes the problem, but I don't know if I've broken something elsewhere. Can't thank you enough for the awesome work on this module.

Ryan D.
Average of ratings: -
In reply to Ryan Dorcey

Re: Display method not defined for question.

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
Hi Ryan -

That issue has been fixed in the latest version in CVS. There's a number of other arguments that need to go into that call.

mike
In reply to Mike Churchward

Re: Display method not defined for question.

by Ken Gibson -

Mike...how about the zipped version?  I am getting that error as well.

Ken

In reply to Ken Gibson

Re: Display method not defined for question.

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
The zipped versions are made nightly, so you may need to get a new one. Theoretically, it could take 24 hours.

mike
In reply to Mike Churchward

Re: Display method not defined for question.

by Skip Marshall -
Hi Mike,
I'm getting the same message.  I updated to the Zip published on Friday, but get the same result.  Any idea?

Thanks,
Skip
In reply to Skip Marshall

Re: Display method not defined for question.

by Ken Gibson -

Mike...me too. 
Using the Friday, 17th, 2006 zip file and still getting the error.

Ken

In reply to Mike Churchward

Re: Display method not defined for question.

by Ryan Dorcey -
Hi Mike,
I think you're referring to the constructor in locallib.php. The other one in questiontypes.class.php needs the additional arguments. Let me know if I can provide any other information. Thanks.

Ryan D.
In reply to Ryan Dorcey

Re: Display method not defined for question.

by Skip Marshall -
Hi Ryan,
Nice catch.  I made the change in line 170 of the questiontypes.class.php file noted above and it works like a charm.

Mike- fantastic work on this module.  Thanks.

Skip
In reply to Skip Marshall

Re: Display method not defined for question.

by Matt Cromwell -
YEAH FOR RYAN!!!

I also just applied the fix (we're obviously using PHP5) and it's works great now!

Thanks Mike for the great module! I don't envy you in this bugg-squashing endevour mixed

MC
In reply to Ryan Dorcey

Re: Display method not defined for question.

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
angryblushapprove

Thanks Ryan. I've fixed it and uploaded it to CVS.

mike
In reply to Mike Churchward

Re: Display method not defined for question.

by Ken Gibson -

Mike,

February 22nd - I deleted my questionaire directory and uploaded the updated zip file today.  But I received the same "Display method not defined for question"  error :-<

I applied Ryan's patch to the questiontypes.class.php file
(posted above)...and that fixed my display problem.  So the February 22nd Zip file still has the errant code.

Ken

In reply to Ken Gibson

Re: Display method not defined for question.

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
Hi Ken -

I just now downloaded the zip and checked. That change is there. I'm not sure what happened when you tried.

mike
In reply to Mike Churchward

Re: Display method not defined for question.

by Ken Gibson -

Mike,

Just downloaded the : Friday, 24 February 2006, 10:22 AM zipped build.
Fixed all my issues. 10,000 thanks. smile

ken