Commit 7928024c authored by git's avatar git Committed by tim.plunkett
Browse files

Issue #1306196 by DuaelFr, dkinzer, DanzI, tim.plunkett: Fixed ->total_rows() is null.

parent d3ab54e4
......@@ -1482,7 +1482,7 @@ function execute(&$view) {
$this->pager->post_execute($view->result);
if ($this->pager->use_pager()) {
if ($this->pager->use_count_query() || !empty($view->get_total_rows)) {
$view->total_rows = $this->pager->get_total_items();
}
}
......
......@@ -175,6 +175,25 @@ class ViewsPagerTest extends ViewsSqlTest {
return $view;
}
public function testViewTotalRowsWithoutPager() {
$this->createNodes(23);
$view = $this->viewsPagerNoLimit();
$view->get_total_rows = TRUE;
$view->set_display('default');
$this->executeView($view);
$this->assertEqual($view->total_rows, 23, "'total_rows' is calculated when pager type is 'none' and 'get_total_rows' is TRUE.");
}
public function createNodes($count) {
if ($count >= 0) {
for ($i = 0; $i < $count; $i++) {
$this->drupalCreateNode();
}
}
}
/**
* Tests the some pager plugin.
*/
......
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