diff --git a/system/Model.php b/system/Model.php index 767f7de08048..418b3057eeb9 100644 --- a/system/Model.php +++ b/system/Model.php @@ -588,11 +588,13 @@ protected function shouldUpdate($data): bool return false; } + if ($this->useAutoIncrement === true) { + return true; + } + // When useAutoIncrement feature is disabled, check // in the database if given record already exists - return $this->useAutoIncrement - ? true - : $this->where($this->primaryKey, $this->getIdValue($data))->countAllResults() === 1; + return $this->where($this->primaryKey, $this->getIdValue($data))->countAllResults() === 1; } /**