Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 3.5.4, 3.6.2
-
Component/s: User management
Description
The install process for the *auth_joomdle (Joomdle) plugin creates a system user. This fails because it uses *user/lib.php:user_create_user() which purges caches for the user, but during install the caching is disabled.
This was first reported in a forum post (also [in the Joomdle forum|http://www.joomdle.com/forum/installation/12450-health-check-fail-with-database-error).]
It looks like this issue was introduced following the changes made in MDL-61707 and revised in MDL-63677.
This is a bit of an edge-case but maybe there are other situations where a user could be created but caching is disabled.
To reproduce this issue:
- Set up a Moodle site, either 3.5.4 or 3.6.2.
- Download auth_joomdle, either 2008080292 for 3.5 or 2008080294 for 3.6.
- Extract the plugin files to the site's auth directory.
- Log in as an adminstrator to perform the install, or run admin/cli/upgrade.php.
What I expected:
The plugin to be installed without error.
What actually happens:
Installing via the CLI on Moodle 3.5.4:
-->auth_joomdle
Default exception handler: Exception - Call to undefined method cache_disabled::purge_current_user() Debug:
Error code: generalexceptionmessage
- 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 605 of /lib/upgradelib.php: call to xmldb_auth_joomdle_install()
- line 1857 of /lib/upgradelib.php: call to upgrade_plugins()
- line 182 of /admin/cli/upgrade.php: call to upgrade_noncore()