Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-64719

Purge cache on user create fails if caching disabled

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5.4, 3.6.2
    • Fix Version/s: 3.5.6, 3.6.4
    • Component/s: User management
    • Labels:

      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:

      1. Set up a Moodle site, either 3.5.4 or 3.6.2.
      2. Download auth_joomdle, either 2008080292 for 3.5 or 2008080294 for 3.6.
      3. Extract the plugin files to the site's auth directory.
      4. 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()

        Attachments

          Activity

            People

            • Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/May/19

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 30 minutes
                2h 30m