500 error on adding a certificate

500 error on adding a certificate

by jeff masiello -
Number of replies: 7

I installed the latest certificate module. Moodle version is 2.0.1+

I did the upgrade and went to add a certificate tot he course. When I do I get this error...

Fatal error: Call to undefined method stdClass::get_cms() in C:\inetpub\moodle\mod\certificate\lib.php on line 886

 

Average of ratings: -
In reply to jeff masiello

Re: 500 error on adding a certificate

by Mark Nelson -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Jeff,

I suggest upgrading your Moodle install regardless of the fact the certificate version is not working on this version. This is a very old version and contains known security issues.

Regarding your issue, it seems the file lib/modinfolib.php was introduced later in the 2.0 branch but not in 2.0.1. To fix your issue simply change (I haven't tested this but it *should* work) the line "$mods = $modinfo->get_cms();" to "$mods = $modinfo->cms;" in mod/certificate/lib.php. Again, I suggest upgrading your Moodle site instead of this.

Regards,

Mark

In reply to jeff masiello

Re: 500 error on adding a certificate

by Mark Nelson -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

I created https://tracker.moodle.org/browse/CONTRIB-4139 to keep track of this.

In reply to Mark Nelson

Re: 500 error on adding a certificate

by Ellen Kinsel -

The tracker entry says "...early version of the certificate module will fail."

I am using the latest version (Dec 13 2012) in Moodle 2.4.1 and getting the error shown below. I turned on debugging to the developer level, but I did not get any additional information.

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@learningcentremxu.ca and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at learningcentremxu.ca Port 80

 

In reply to Mark Nelson

Re: 500 error on adding a certificate

by Ellen Kinsel -

After receiving notification of an update, I installed it, but still get the same error. I installed it "over the top" of the original module in order to avoid having to reload my custom graphics. Would this make a difference?

In reply to Ellen Kinsel

Re: 500 error on adding a certificate

by Mark Nelson -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Ellen,

Your issue is completely different to the one posted here. The issue here was that the certificate was using a function that was only introduced later in Moodle 2.0.x branch, so early versions of the Moodle 2, in this case 2.0.1 were failing.

A 500 error can mean several things and is not limited to one error. I suggest turning debugging on your site (see http://docs.moodle.org/23/en/Debugging) and copying the error message you receive (if at all) from Moodle here. It could also be a permissions issue where you need to make the certificate module folder readable by the web server.

Regards,

Mark

In reply to Mark Nelson

Re: 500 error on adding a certificate

by Ellen Kinsel -

As I mentioned in a previous post, I turned on debugging, but I did not get any errors other than the one copied in the message. Will continue to investigate regarding permissions.

In reply to Ellen Kinsel

Re: 500 error on adding a certificate

by Tim Lovett -

Any news?

I've exactly the same issue as Ellen.

I have a new Moodle 2.4.1 and have imported with courses (with student results) without any hickups from Moodle 2.2.1

Now I am trying to make course backups in Moodle 2.4.1. The first course worked, after that I get the 500 error...  ?