Skip to content

Commit

Permalink
MDL-83617 gradereport_grader: fix encoding url
Browse files Browse the repository at this point in the history
When changing the number of grades per page, the redirect url was encoded twice.
  • Loading branch information
jboulen committed Nov 1, 2024
1 parent d015c4c commit 297ed4e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion grade/report/grader/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
}

$perpagedata = [
'baseurl' => new moodle_url('/grade/report/grader/index.php', ['id' => s($courseid), 'report' => 'grader']),
'baseurl' => (new moodle_url('/grade/report/grader/index.php', ['id' => s($courseid), 'report' => 'grader']))->out(false),
'options' => []
];
foreach ($pagingoptions as $key => $name) {
Expand Down
2 changes: 1 addition & 1 deletion grade/report/grader/templates/perpage.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</label>
{{#js}}
document.getElementById('{{uniqid}}').addEventListener('change', function(e) {
var url = new URL('{{baseurl}}');
var url = new URL('{{{baseurl}}}');
url.searchParams.set('perpage', e.target.value);
window.location.href = url;
Expand Down
1 change: 1 addition & 0 deletions grade/report/grader/tests/behat/pagination.feature
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Feature: grader report pagination
Then I should see "103" node occurrences of type "tr" in the "user-grades" "table"
And I should see "2" in the ".stickyfooter .pagination" "css_element"
And I should not see "3" in the ".stickyfooter .pagination" "css_element"
And the url should match "#/grade/report/grader/index\.php\?id=[0-9]+&report=grader&perpage=100#"

@javascript
Scenario: The pagination bar is only displayed when there is more than one page
Expand Down

0 comments on commit 297ed4e

Please sign in to comment.