diff --git a/lib/Cake/Model/Datasource/DboSource.php b/lib/Cake/Model/Datasource/DboSource.php index d356492df2..dcf7e47b48 100644 --- a/lib/Cake/Model/Datasource/DboSource.php +++ b/lib/Cake/Model/Datasource/DboSource.php @@ -2464,6 +2464,12 @@ public function commit() { $this->took = $this->numRows = $this->affected = false; $this->logQuery('COMMIT'); } + + if (!$this->_connection->inTransaction()) { + error_log('Commit failed: Transaction is not active'); + return false; + } + $this->_transactionStarted = false; return $this->_connection->commit(); } diff --git a/lib/Cake/Network/CakeRequest.php b/lib/Cake/Network/CakeRequest.php index f8f5e176c8..67a1d09816 100644 --- a/lib/Cake/Network/CakeRequest.php +++ b/lib/Cake/Network/CakeRequest.php @@ -1116,7 +1116,7 @@ protected function _readInput() { * @param mixed $name Name of the key being accessed. * @return mixed */ - public function offsetGet(mixed $name) : mixed { + public function offsetGet($name) : mixed { if (isset($this->params[$name])) { return $this->params[$name]; } @@ -1136,7 +1136,7 @@ public function offsetGet(mixed $name) : mixed { * @param mixed $value The value being written. * @return void */ - public function offsetSet(mixed $name, mixed $value) : void { + public function offsetSet($name, $value) : void { $this->params[$name] = $value; } @@ -1146,7 +1146,7 @@ public function offsetSet(mixed $name, mixed $value) : void { * @param mixed $name thing to check. * @return bool */ - public function offsetExists(mixed $name) : bool { + public function offsetExists($name) : bool { if ($name === 'url' || $name === 'data') { return true; } @@ -1159,7 +1159,7 @@ public function offsetExists(mixed $name) : bool { * @param string $name Name to unset. * @return void */ - public function offsetUnset(mixed $name) : void { + public function offsetUnset($name) : void { unset($this->params[$name]); }