Skip to content
Snippets Groups Projects
Commit 753bc588 authored by Steven Wittens's avatar Steven Wittens
Browse files

- Fix mistakes in pager patch.

parent 48d3ef60
No related branches found
Tags 8.x-2.37
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -72,13 +72,13 @@ function pager_query($query, $limit = 10, $element = 0, $count_query = NULL) {
if (count($args)) {
$pager_total_items[$element] = db_result(db_query($count_query, $args));
$pager_total[$element] = ceil($pager_total_items[$element] / $limit);
$pager_page_array[$element] = max(0, min(((int)$pager_total[$element]) - 1));
$pager_page_array[$element] = max(0, min($pager_page_array[$element], ((int)$pager_total[$element]) - 1));
return db_query_range($query, $args, $pager_page_array[$element] * $limit, $limit);
}
else {
$pager_total_items[$element] = db_result(db_query($count_query));
$pager_total[$element] = ceil($pager_total_items[$element] / $limit);
$pager_page_array[$element] = max(0, min(((int)$pager_total[$element]) - 1));
$pager_page_array[$element] = max(0, min($pager_page_array[$element], ((int)$pager_total[$element]) - 1));
return db_query_range($query, $pager_page_array[$element] * $limit, $limit);
}
}
......@@ -384,7 +384,7 @@ function theme_pager_list($limit, $element = 0, $quantity = 5, $text = '', $attr
* @return
* An HTML string that generates the link.
*/
function theme_pager_link($page_new, $element, $attributes = array()) {
function theme_pager_link($text, $page_new, $element, $attributes = array()) {
$q = $_GET['q'];
$page = array_key_exists('page', $_GET) ? $_GET['page'] : '';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment