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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.9
    • 1.9.1
    • Course
    • None
    • Any
    • Any
    • MOODLE_19_STABLE
    • 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).

      Attachments

        Activity

          People

            garethmorgan Gareth Morgan
            garethmorgan Gareth Morgan
            Petr Skoda Petr Skoda
            Amaia Anabitarte, Carlos Escobedo, Laurent David, Mikel Martín Corrales, Sabina Abellan, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              15/May/08