[BUGFIX] DBAL: Permission error when saving a new record 34/39334/2
authorXavier Perseguers <xavier@typo3.org>
Thu, 7 May 2015 15:04:35 +0000 (17:04 +0200)
committerXavier Perseguers <xavier@typo3.org>
Thu, 7 May 2015 15:14:20 +0000 (17:14 +0200)
Last generated ID is not stored and makes the authorization
check fail when the record is saved and edited.

Change-Id: I5b3da01219239c2ecb559f2caa492c460a310332
Releases: master, 6.2
Resolves: #66843
Related: #66680
Reviewed-on: http://review.typo3.org/39334
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Xavier Perseguers <xavier@typo3.org>
Tested-by: Xavier Perseguers <xavier@typo3.org>
typo3/sysext/dbal/Classes/Database/DatabaseConnection.php

index ddee5ea..35e24b8 100644 (file)
@@ -529,6 +529,9 @@ class DatabaseConnection extends \TYPO3\CMS\Core\Database\DatabaseConnection {
                                                if ($this->handlerInstance[$this->lastHandlerKey]->hasInsertID) {
                                                        // The table is able to retrieve the ID of the last insert, use it to update the blob below
                                                        $new_id = $this->handlerInstance[$this->lastHandlerKey]->Insert_ID($table, $this->cache_autoIncFields[$table]);
+                                                       if ($table !== 'tx_dbal_debuglog') {
+                                                               $this->handlerInstance[$this->lastHandlerKey]->last_insert_id = $new_id;
+                                                       }
                                                }
                                        }
                                        if (is_array($this->lastQuery[1])) {