Commit 6853aed4 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1771473: Confusion of sorting



The baseurl for the pagination was not getting set correctly if 'all'
tags was joined with a special sort/filter.

behatnotneeded

Change-Id: Ic5ebcd4388b7808062a91ea463031e4c5ffa2083
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 9b8b8ad5
......@@ -4547,6 +4547,13 @@ function build_portfolio_search_html(&$data) {
$data->basejsonurl = 'json/tagsearch.php';
}
if (isset($data->sort) && $data->sort != 'name') {
$data->baseurl .= (strpos($data->baseurl, '?') ? '&' : '?') . 'sort=' . $data->sort;
}
if (isset($data->filter) && $data->filter != 'all') {
$data->baseurl .= (strpos($data->baseurl, '?') ? '&' : '?') . 'type=' . $data->filter;
}
$data->sortcols = array('name', 'date');
$data->filtercols = array(
'all' => get_string('tagfilter_all'),
......@@ -4568,7 +4575,7 @@ function build_portfolio_search_html(&$data) {
$pagination = build_pagination(array(
'id' => 'results_pagination',
'class' => 'center',
'url' => $data->baseurl . ($data->sort == 'name' ? '' : '&sort=' . $data->sort) . ($data->filter == 'all' ? '' : '&type=' . $data->filter),
'url' => $data->baseurl,
'jsonscript' => $data->basejsonurl,
'datatable' => 'results',
'count' => $data->count,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment