Commit 5e911ec7 authored by Robert Lyon's avatar Robert Lyon Committed by Cecilia Vela Gurovic
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>
(cherry picked from commit 9818f19c)
(cherry picked from commit e250e696)
parent 495056b9
......@@ -4330,6 +4330,14 @@ function build_portfolio_search_html(&$data) {
}
$data->baseurl = get_config('wwwroot') . 'tags.php' . (is_null($data->tag) ? '' : '?tag=' . urlencode($data->tag));
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'),
......@@ -4347,7 +4355,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' => 'json/tagsearch.php',
'datatable' => 'results',
'count' => $data->count,
......
Supports Markdown
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