Moodle
  1. Moodle
  2. MDL-24299

Back to the list of all roles link when assigning a system role does not work

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.2
    • Component/s: Roles / Access
    • Labels:
    • Rank:
      961

      Description

      As reported by Olumuyiwa Taiwo:

      In the "Assign roles" page in Moodle 2.0, clicking the "Back to the list of all roles" link at the bottom of the page returns to the "Assign roles" page (i.e. the user stays on the same page).

      The issue seems to happen when assigning roles in system context, for example http://qa.moodle.net/admin/roles/assign.php?contextid=1&roleid=1&section=assignroles

        Activity

        Hide
        Tomasz Muras added a comment -

        Only admin/roles/assign.php needs fixing, here is a simple patch:
        diff --git a/admin/roles/assign.php b/admin/roles/assign.php
        index 6922350..65aa221 100755
        — a/admin/roles/assign.php
        +++ b/admin/roles/assign.php
        @@ 232,7 +232,8 @@ $assignurl = new moodle_url($PAGE>url, array('roleid'=>$roleid));
        $select = new single_select($PAGE->url, 'roleid', $nameswithcounts, $roleid, null);
        $select->label = get_string('assignanotherrole', 'role');
        echo $OUTPUT->render($select);

        • echo '<p><a href="' . $PAGE->url . '">' . get_string('backtoallroles', 'role') . '</a></p>';
          + $backurl = new moodle_url('/admin/roles/assign.php', array('contextid' => $contextid));
          + echo '<p><a href="' . $backurl->out() . '">' . get_string('backtoallroles', 'role') . '</a></p>';
          echo '</div>';

        } else if (empty($assignableroles)) {

        Show
        Tomasz Muras added a comment - Only admin/roles/assign.php needs fixing, here is a simple patch: diff --git a/admin/roles/assign.php b/admin/roles/assign.php index 6922350..65aa221 100755 — a/admin/roles/assign.php +++ b/admin/roles/assign.php @@ 232,7 +232,8 @@ $assignurl = new moodle_url($PAGE >url, array('roleid'=>$roleid)); $select = new single_select($PAGE->url, 'roleid', $nameswithcounts, $roleid, null); $select->label = get_string('assignanotherrole', 'role'); echo $OUTPUT->render($select); echo '<p><a href="' . $PAGE->url . '">' . get_string('backtoallroles', 'role') . '</a></p>'; + $backurl = new moodle_url('/admin/roles/assign.php', array('contextid' => $contextid)); + echo '<p><a href="' . $backurl->out() . '">' . get_string('backtoallroles', 'role') . '</a></p>'; echo '</div>'; } else if (empty($assignableroles)) {
        Hide
        Helen Foster added a comment -

        Tomasz, thanks a lot for your patch

        Setting the fix version as stable backlog for this issue to be considered for inclusion in a forthcoming sprint.

        Show
        Helen Foster added a comment - Tomasz, thanks a lot for your patch Setting the fix version as stable backlog for this issue to be considered for inclusion in a forthcoming sprint.
        Hide
        Dan Poltawski added a comment -

        Thanks, i've tested it and requested a merge in PULL-66

        Show
        Dan Poltawski added a comment - Thanks, i've tested it and requested a merge in PULL-66

          People

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

            Dates

            • Created:
              Updated:
              Resolved: