Skip to content

Commit 178fb17

Browse files
authored
countAllResults(true, false)
Additional bug fix: ErrorException Undefined variable: orderby in call: $builder->countAllResults(true, true|false) when $this->QBOrderBy is empty.
1 parent a363e0a commit 178fb17

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

system/Database/BaseBuilder.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1451,6 +1451,7 @@ public function countAllResults($reset = true, $test = false)
14511451
// ORDER BY usage is often problematic here (most notably
14521452
// on Microsoft SQL Server) and ultimately unnecessary
14531453
// for selecting COUNT(*) ...
1454+
$orderby = [];
14541455
if ( ! empty($this->QBOrderBy))
14551456
{
14561457
$orderby = $this->QBOrderBy;
@@ -1474,7 +1475,7 @@ public function countAllResults($reset = true, $test = false)
14741475
// If we've previously reset the QBOrderBy values, get them back
14751476
elseif ( ! isset($this->QBOrderBy))
14761477
{
1477-
$this->QBOrderBy = $orderby;
1478+
$this->QBOrderBy = $orderby??[];
14781479
}
14791480

14801481
$row = (! $result instanceof ResultInterface)

0 commit comments

Comments
 (0)