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

Old module display script mod.php (which is core) does not support role overrides page for non-formslib modules

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9.1
    • Component/s: Course
    • Labels:
      None
    • Environment:
      Any
    • Database:
      Any
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      I have recently done an upgrade of the Questionnaire module to support Roles and Permissions. This does not use formslib, so is accessed through mod.php rather than modedit.php. However, the roles overrides tab was not showing. Comparing it to modedit, the problem appeared to be the omission of these two lines from mod.php.

      if (!empty($cm->id))

      { $context = get_context_instance(CONTEXT_MODULE, $cm->id); $currenttab = 'update'; //Added lines - start $overridableroles = get_overridable_roles($context); $assignableroles = get_assignable_roles($context); //Added lines - end include_once($CFG->dirroot.'/'.$CFG->admin.'/roles/tabs.php'); }

      I've included a patch for this module, built against 1.9. It should also correct the problem if it is happening on HEAD, because course/mod.php appears to be identical between 1.9 and HEAD, I will shortly be installing a HEAD environment anyway and will test it then.

      (I suppose there is just a small risk that this could cause problems with other modules which may have been written to be reliant on it not working properly).

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  15/May/08