From 55807d7e4b465036a23016de30a494a7999a1391 Mon Sep 17 00:00:00 2001 From: Najdanovic Ivan Date: Wed, 6 Jan 2021 20:50:00 +0100 Subject: [PATCH 1/2] BaseModel - Remove usage of primaryKey property which was left out when split was done --- system/BaseModel.php | 7 ------- 1 file changed, 7 deletions(-) diff --git a/system/BaseModel.php b/system/BaseModel.php index 5364d8dc6ad1..badf57e1a85b 100644 --- a/system/BaseModel.php +++ b/system/BaseModel.php @@ -1675,13 +1675,6 @@ protected function objectToRawArray($data, bool $onlyChanged = true, bool $recur if (method_exists($data, 'toRawArray')) { $properties = $data->toRawArray($onlyChanged, $recursive); - - // Always grab the primary key otherwise updates will fail. - if (! empty($properties) && ! empty($this->primaryKey) && ! in_array($this->primaryKey, $properties, true) - && ! empty($data->{$this->primaryKey})) - { - $properties[$this->primaryKey] = $data->{$this->primaryKey}; - } } else { From b01cb989ff70faa8755e8b9bda63e0d5a978508a Mon Sep 17 00:00:00 2001 From: Najdanovic Ivan Date: Wed, 6 Jan 2021 21:05:33 +0100 Subject: [PATCH 2/2] Model - Added @throws tag in Builder Method --- system/Model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/system/Model.php b/system/Model.php index ef3bc0f010f5..dbb2584dfab0 100644 --- a/system/Model.php +++ b/system/Model.php @@ -560,6 +560,7 @@ public function countAllResults(bool $reset = true, bool $test = false) * @param string|null $table Table name * * @return BaseBuilder + * @throws ModelException */ public function builder(?string $table = null) {