Class "Object" not found

Class "Object" not found

by Michael Rice -
Number of replies: 2

Recently I upgraded from moodle 3.3.1 to 3.4 and php to 7.0. After the update cron stopped working.  I am getting the error Class "Object" not found from my SSO module. I am using moodle-drupalservices as an SSO between our drupal site and moodle. The code that is throwing the error is $user = new object(); in auth.php. The comment right above the code is "// build the new user object to be put into the Moodle database".

Any ideas on how to fix the error?

Average of ratings: -
In reply to Michael Rice

Re: Class "Object" not found

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

it's due to your upgrade to PHP 7  - google would probably help but you should be able to change "object()" to "stdclass()" - but you may run into other issues with 3rd party code that isn't supported well.

In reply to Dan Marsden

Re: Class "Object" not found

by Michael Rice -

Thanks! I wasn't sure if it was the moodle or php update that broke the code.  I will look into stdclass() and make a note in the github repo.