Skip to content

Commit a0a55ed

Browse files
committed
fix: when useAutoIncrement is disabled, countAllResults() is called
1 parent d68e7f3 commit a0a55ed

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

system/Model.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,12 +584,12 @@ public function set($key, $value = '', ?bool $escape = null)
584584
*/
585585
protected function shouldUpdate($data): bool
586586
{
587-
// When useAutoIncrement feature is disabled check
587+
// When useAutoIncrement feature is disabled, check
588588
// in the database if given record already exists
589589
return parent::shouldUpdate($data)
590-
&& $this->useAutoIncrement
590+
&& ($this->useAutoIncrement
591591
? true
592-
: $this->where($this->primaryKey, $this->getIdValue($data))->countAllResults() === 1;
592+
: $this->where($this->primaryKey, $this->getIdValue($data))->countAllResults() === 1);
593593
}
594594

595595
/**

0 commit comments

Comments
 (0)