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

Availability plugins cannot have a settings page

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 2.6.7, 2.6.8, 2.6.9, 2.6.10, 2.6.11, 2.7.4, 2.7.5, 2.7.6, 2.7.7, 2.7.8, 2.8.2, 2.8.3, 2.8.4, 2.8.5, 2.8.6, 2.9
    • Restrict access
    • MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE

      The settings.php file inside an availability plugin is ignored.
      The reason is the method load_settings is not overrided for the availability class (in lib/classes/plugininfo/availability.php)

      adding the following chunk to the availability class definition could resolve the issue:

      public function load_settings(\part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig) {
          global $CFG, $USER, $DB, $OUTPUT, $PAGE; // In case settings.php wants to refer to them.
          $ADMIN = $adminroot; // May be used in settings.php.
          $plugininfo = $this; // Also can be used inside settings.php.
       
          if (!$this->is_installed_and_upgraded()) {
              return;
          }
       
          if (file_exists($this->full_path('settings.php'))) {
              include($this->full_path('settings.php'));
          }
      }
      

            Unassigned Unassigned
            rezaie9 Shamim Rezaie
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

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