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

Repository API incorrectly saves configuration to config_plugin table

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.5
    • Repositories
    • MOODLE_405_STABLE

      While upgrading mod_equella https://github.com/openequella/moodle-mod_openEQUELLA to the latest version we have noticed failing core unit tests. See https://github.com/openequella/moodle-mod_openEQUELLA/issues/110

      However, during investigation we realised that actually core API incorrectly saves repository configuration to config_plugin table here https://github.com/moodle/moodle/blob/main/repository/lib.php#L311 It uses $this->_typename without prefixing it to plugin type so for equella it looks like set_config($name, $value, 'equella'); 

      mod_equella code has changed as part of https://github.com/openequella/moodle-mod_openEQUELLA/commit/7225e988e5c4d1fa17a615069adcedcf85dc9509 and now they store config properly. This exposed core issues with repository configs.

      Steps to replicate:

      1. Bring mod_equella code from https://github.com/openequella/moodle-mod_openEQUELLA
      2. Initialise unit tests env 
      3. Run following core unit tests vendor/bin/phpunit repository/tests/generator_test.php
      4. Confirm it fails

            Unassigned Unassigned
            dmitriim Dmitrii Metelkin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

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