Skip to content

Commit

Permalink
Merge pull request #17323 from mauriciofauth/nav-pagination-4.9
Browse files Browse the repository at this point in the history
[4.9] Fix broken pagination links in the navigation sidebar
  • Loading branch information
MauricioFauth committed Jan 28, 2022
2 parents 014f704 + 8258e1f commit 00ad3cc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
10 changes: 4 additions & 6 deletions js/navigation.js
Expand Up @@ -1036,14 +1036,12 @@ function PMA_selectCurrentDb () {
function PMA_navigationTreePagination ($this) {
var $msgbox = PMA_ajaxShowMessage();
var isDbSelector = $this.closest('div.pageselector').is('.dbselector');
var url;
var params;
var url = 'navigation.php';
var params = 'ajax_request=true';
if ($this[0].tagName === 'A') {
url = $this.attr('href');
params = 'ajax_request=true';
params += PMA_commonParams.get('arg_separator') + $this.getPostData();
} else { // tagName === 'SELECT'
url = 'navigation.php';
params = $this.closest('form').serialize() + PMA_commonParams.get('arg_separator') + 'ajax_request=true';
params += PMA_commonParams.get('arg_separator') + $this.closest('form').serialize();
}
var searchClause = PMA_fastFilter.getSearchClause();
if (searchClause) {
Expand Down
24 changes: 14 additions & 10 deletions libraries/classes/Util.php
Expand Up @@ -2347,13 +2347,15 @@ public static function getListNavigator(

$_url_params[$name] = 0;
$list_navigator_html .= '<a' . $class . $title1 . ' href="' . $script
. Url::getCommon($_url_params) . '">' . $caption1
. '</a>';
. '" data-post="'
. Url::getCommon($_url_params, '', false)
. '">' . $caption1 . '</a>';

$_url_params[$name] = $pos - $max_count;
$list_navigator_html .= ' <a' . $class . $title2
. ' href="' . $script . Url::getCommon($_url_params) . '">'
. $caption2 . '</a>';
$list_navigator_html .= ' <a' . $class . $title2 . ' href="' . $script
. '" data-post="'
. Url::getCommon($_url_params, '', false)
. '">' . $caption2 . '</a>';
}

$list_navigator_html .= '<form action="' . basename($script)
Expand Down Expand Up @@ -2386,17 +2388,19 @@ public static function getListNavigator(

$_url_params[$name] = $pos + $max_count;
$list_navigator_html .= '<a' . $class . $title3 . ' href="' . $script
. Url::getCommon($_url_params) . '" >' . $caption3
. '</a>';
. '" data-post="'
. Url::getCommon($_url_params, '', false)
. '" >' . $caption3 . '</a>';

$_url_params[$name] = floor($count / $max_count) * $max_count;
if ($_url_params[$name] == $count) {
$_url_params[$name] = $count - $max_count;
}

$list_navigator_html .= ' <a' . $class . $title4
. ' href="' . $script . Url::getCommon($_url_params) . '" >'
. $caption4 . '</a>';
$list_navigator_html .= ' <a' . $class . $title4 . ' href="' . $script
. '" data-post="'
. Url::getCommon($_url_params, '', false)
. '" >' . $caption4 . '</a>';
}
$list_navigator_html .= '</div>' . "\n";
}
Expand Down

0 comments on commit 00ad3cc

Please sign in to comment.