Commit 5ff84c63 authored by merlinofchaos's avatar merlinofchaos

#133454: (sarvab) Move some pager variables around so that they're on the ...

#133454: (sarvab) Move some pager variables around so that they're on the  object and more easily modified.
parent e91604c3
......@@ -43,6 +43,7 @@ Views 4.7.x-dev
o Allow RSS channel description to be set as part of the argument option.
o New 'tools' page in UI to clear the views cache.
o #135273: (josh_k) Allow 'edit' handler option to return to view after editing.
o #133454: (sarvab) Move some pager variables around so that they're on the $view object and more easily modified.
Views 4.7.x-1.5
Bugs fixed:
......
......@@ -514,6 +514,11 @@ function views_access($view, $account = NULL) {
// All views with an empty access setting are available to all roles.
if (!$view->access) {
$view->use_pager = $use_pager;
$view->pager_limit = $limit;
$view->page = $page;
$view->offset = $offset;
return TRUE;
}
......@@ -771,13 +776,13 @@ function views_build_view($type, &$view, $args = array(), $use_pager = false, $l
$items = array();
if ($query) {
if ($use_pager) {
if ($view->use_pager) {
$cquery = db_rewrite_sql($info['countquery'], 'node', 'nid', $info['rewrite_args']);
$result = pager_query($query, $limit, $use_pager - 1, $cquery, $info['args']);
$view->total_rows = $GLOBALS['pager_total_items'][$use_pager - 1];
$result = pager_query($query, $view->pager_limit, $view->use_pager - 1, $cquery, $info['args']);
$view->total_rows = $GLOBALS['pager_total_items'][$view->use_pager - 1];
}
else {
$result = ($limit ? db_query_range($query, $info['args'], $page * $limit + $offset, $limit) : db_query($query, $info['args']));
$result = ($view->pager_limit ? db_query_range($query, $info['args'], $view->page * $view->pager_limit + $view->offset, $view->pager_limit) : db_query($query, $info['args']));
}
$view->num_rows = db_num_rows($result);
if ($type == 'result') {
......@@ -803,8 +808,6 @@ function views_build_view($type, &$view, $args = array(), $use_pager = false, $l
$view->real_url = views_get_url($view, $args);
$view->use_pager = $use_pager;
$view->pager_limit = $limit;
$output .= views_theme('views_view', $view, $type, $items, $info['level'], $args);
// Call a hook that'll let modules modify the view just after it is displayed.
......
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