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

cache_disabled is missing check_lock_state, causing issues with some plugin installations

XMLWordPrintable

    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • MDL-76745_401_STABLE
    • MDL-76745_master
    • Hide

      Covered by unit tests. Without the patch to cache/disabledlib.php, the unit tests added to cache/tests/cache_test.php should fail. With the patch, they should pass.

      Quick manual test:

      1. Go to Site administration > Plugins > Caching > Configuration
      2. Edit config.php and add the following:

        define('CACHE_DISABLE_ALL', true);
        

      3. Back on the Cache administration page, search for "coursemodinfo".
      4. On the actions column of the "coursemodinfo" row, click "Purge"
      5. Confirm that the page reloads successfully without any errors.
      Show
      Covered by unit tests. Without the patch to cache/disabledlib.php, the unit tests added to cache/tests/cache_test.php should fail. With the patch, they should pass. Quick manual test: Go to Site administration > Plugins > Caching > Configuration Edit config.php and add the following: define( 'CACHE_DISABLE_ALL' , true); Back on the Cache administration page, search for "coursemodinfo". On the actions column of the "coursemodinfo" row, click "Purge" Confirm that the page reloads successfully without any errors.

      From https://github.com/moodleou/moodle-mod_oublog/issues/129

      When running php admin/tool/phpunit/cli/init.php
      I get the above error. The stack trace leads back to a oublog settings "hack" -

      moodle-mod_oublog/settings.php

      Line 17 in e4c2960
      // Dodgy hack to setup the global blog instance (section not created yet on install).

      This seems to be failing because of a recent update to Moodle: moodle/moodle@ea01fb2

      Commenting out the oublog "hack" enabled installation to continue.

      Moodle 4.1, PHP 8.0, MOODLE_311_STABLE branch of this plugin

      Stack trace:
      Default exception handler: Exception - Call to undefined method cache_disabled::check_lock_state() Debug:
      Error code: generalexceptionmessage

      line 670 of /lib/modinfolib.php: Error thrown
      line 649 of /lib/modinfolib.php: call to course_modinfo::inner_build_course_cache()
      line 478 of /lib/modinfolib.php: call to course_modinfo::build_course_cache()
      line 436 of /lib/modinfolib.php: call to course_modinfo->__construct()
      line 2532 of /lib/modinfolib.php: call to course_modinfo::instance()
      line 589 of /course/lib.php: call to get_fast_modinfo()
      line 632 of /course/lib.php: call to course_create_sections_if_missing()
      line 22 of /mod/oublog/settings.php: call to course_add_cm_to_section()
      line 140 of /lib/classes/plugininfo/mod.php: call to include()
      line 47 of /admin/settings/plugins.php: call to core\plugininfo\mod->load_settings()
      line 8831 of /lib/adminlib.php: call to require()
      line 8857 of /lib/adminlib.php: call to admin_get_root()
      line 522 of /lib/installlib.php: call to admin_apply_default_settings()
      line 468 of /lib/phpunit/classes/util.php: call to install_cli_database()
      line 150 of /admin/tool/phpunit/cli/util.php: call to phpunit_util::install_site()

      !!! Exception - Call to undefined method cache_disabled::check_lock_state() !!!
      !!
      Error code: generalexceptionmessage !!
      !! Stack trace: * line 670 of /lib/modinfolib.php: Error thrown

      line 649 of /lib/modinfolib.php: call to course_modinfo::inner_build_course_cache()
      line 478 of /lib/modinfolib.php: call to course_modinfo::build_course_cache()
      line 436 of /lib/modinfolib.php: call to course_modinfo->__construct()
      line 2532 of /lib/modinfolib.php: call to course_modinfo::instance()
      line 589 of /course/lib.php: call to get_fast_modinfo()
      line 632 of /course/lib.php: call to course_create_sections_if_missing()
      line 22 of /mod/oublog/settings.php: call to course_add_cm_to_section()
      line 140 of /lib/classes/plugininfo/mod.php: call to include()
      line 47 of /admin/settings/plugins.php: call to core\plugininfo\mod->load_settings()
      line 8831 of /lib/adminlib.php: call to require()
      line 8857 of /lib/adminlib.php: call to admin_get_root()
      line 522 of /lib/installlib.php: call to admin_apply_default_settings()
      line 468 of /lib/phpunit/classes/util.php: call to install_cli_database()
      line 150 of /admin/tool/phpunit/cli/util.php: call to phpunit_util::install_site()
      !!

      This is due to cache_disabled not defining check_lock_state.

            marxjohnson Mark Johnson
            marxjohnson Mark Johnson
            Tim Hunt Tim Hunt
            Jun Pataleta Jun Pataleta
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            4 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved:

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

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.