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

MUC: No way to add file locking plugin

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 2.5
    • 2.4.3
    • Caching
    • MOODLE_24_STABLE
    • MOODLE_25_STABLE
    • wip-MDL-39312-m25
    • Moderate
    • Hide

      There's no good way to test this yet as no cache definitions use locking.

      1. Perform a fresh install (both web + cli).
      2. Upgrade a site (both web + cli).
      3. Install the nolock plugin Sam M attached to this issue and trigger the upgrade.
      4. Log in as an admin.
      5. Browse to Settings > Plugins > Caching > Configuration.
      6. Locate the locks table and the select box below it to add a new instance.
      7. Check you can't delete the default lock instance.
      8. Add a new file lock instance.
      9. Add a new nolock instance.
      10. Edit any store and set it to use the file lock instance.
      11. Edit any store and set it to use the nolock instance.
      12. Check that you can not delete any of the lock instances.
      13. Edit one of the definitions again and set it back to the default.
      14. Check you can now delete the lock instance that is no longer used.
      15. Delete it.
      16. Browse around the site a bit just to check that things are exactly as they were before.
      Show
      There's no good way to test this yet as no cache definitions use locking. Perform a fresh install (both web + cli). Upgrade a site (both web + cli). Install the nolock plugin Sam M attached to this issue and trigger the upgrade. Log in as an admin. Browse to Settings > Plugins > Caching > Configuration. Locate the locks table and the select box below it to add a new instance. Check you can't delete the default lock instance. Add a new file lock instance. Add a new nolock instance. Edit any store and set it to use the file lock instance. Edit any store and set it to use the nolock instance. Check that you can not delete any of the lock instances. Edit one of the definitions again and set it back to the default. Check you can now delete the lock instance that is no longer used. Delete it. Browse around the site a bit just to check that things are exactly as they were before.

      If you create a new file locking plugin, it does not seem to appear in the interface.

      Steps to reproduce:

      1. Create plugin in normal way (put contents of attached zip file into /cache/locks/nolock folder within Moodle code base, so that there is a file /cache/nolocks/nolock/lib.php).

      2. Visit admin page to update. Note that the new plugin is updated and recognised.

      3. Go to the cache administration page (Plugins/Caching/Configuration).

      EXPECTED: The new lock type should be shown under 'Summary of cache lock instances'.
      BEFORE FIX: Only default locking is shown.

      4. Next to 'File cache', click 'Add instance'. Try the 'Lock method' dropdown.

      EXPECTED: The new lock type should be shown as an option.
      BEFORE FIX: Only default locking is shown.

      As a workaround, you can manually edit this file:

      (dataroot)/muc/config.php

      Add the following section to the locks array at the end:

          'cachelock_nolock' => 
          array (
            'name' => 'cachelock_nolock',
            'type' => 'cachelock_nolock',
            'dir' => 'filelocks',
            'default' => false,
          ),
      

      After this it will now work (although it doesn't use the lang string from the lock plugin...)

            samhemelryk Sam Hemelryk
            quen Sam Marshall
            Damyon Wiese Damyon Wiese
            Mark Nelson Mark Nelson
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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