Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
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
......@@ -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.
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment