Error when Installing Joomdle

Error when Installing Joomdle

by Reuel Sample -
Number of replies: 3

Good morning.

I am getting the following when trying to install Joomdle:

Exception - Call to undefined method cache_disabled::purge_current_user()

×Debug info:
Error code: generalexceptionmessage
×Stack trace:
line 131 of /user/lib.php: Error thrown
line 81 of /auth/joomdle/db/install.php: call to user_create_user()
line 29 of /auth/joomdle/db/install.php: call to joomdle_moodle_config->create_user()
line 610 of /lib/upgradelib.php: call to xmldb_auth_joomdle_install()
line 1852 of /lib/upgradelib.php: call to upgrade_plugins()
line 694 of /admin/index.php: call to upgrade_noncore()

I am using Moodle 3.6 on PHP 7.1.

Thanks!

-Reuel+

Average of ratings: -
In reply to Reuel Sample

Re: Error when Installing Joomdle

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

I think this is due to a bug in Moodle so I've added a Tracker issue: MDL-64719.

If you're comfortable editing your site's source code you can make the following change to the function user_create_user() in user/lib.php, looking for the following lines (should be lines 129 to 131:

    // Purge the associated caches for the current user only.
    $presignupcache = \cache::make('core', 'presignup');
    $presignupcache->purge_current_user();

and changing the last line so this becomes:

    // Purge the associated caches for the current user only.
    $presignupcache = \cache::make('core', 'presignup');

    if (get_class($presignupcache) !== 'cache_disabled') {
         $presignupcache->purge_current_user();
    }

I tested this and I was able to install Joomdle after this change.

In reply to Leon Stringer

Re: Error when Installing Joomdle

by Reuel Sample -

Worked like a charm!  Thank you!

Question - should I not update Moodle until this bug is solved?

Thanks again!

-Reuel+

In reply to Reuel Sample

Re: Error when Installing Joomdle

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Great news! The bug only occurs during the plugin's installation so once installed you should be able to use the unmodified Moodle source code to keep your site up-to-date.