Skip to content

Commit

Permalink
MDL-69458 report_insights: Respect perpage value in pagination bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Mihail Geshoski authored and andrewnicols committed Aug 27, 2020
1 parent dddff39 commit fa3b387
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions report/insights/classes/output/insights_list.php
Expand Up @@ -199,6 +199,8 @@ public function export_for_template(\renderer_base $output) {
$data->noinsights = $notification->export_for_template($output);
}

$url = $PAGE->url;

if ($this->othermodels) {

$options = array();
Expand All @@ -207,14 +209,15 @@ public function export_for_template(\renderer_base $output) {
}

// New moodle_url instance returned by magic_get_url.
$url = $PAGE->url;
$url->remove_params('modelid');
$modelselector = new \single_select($url, 'modelid', $options, '',
array('' => get_string('selectotherinsights', 'report_insights')));
$data->modelselector = $modelselector->export_for_template($output);
}

$data->pagingbar = $output->render(new \paging_bar($total, $this->page, $this->perpage, $PAGE->url));
// Add the 'perpage' parameter to the url which is later used to generate the pagination links.
$url->param('perpage', $this->perpage);
$data->pagingbar = $output->render(new \paging_bar($total, $this->page, $this->perpage, $url));

return $data;
}
Expand Down

0 comments on commit fa3b387

Please sign in to comment.