Skip to content

Commit

Permalink
[BUGFIX] Ensure uid is not updated when updating resources
Browse files Browse the repository at this point in the history
When updating entries, the `updateFields` will provide `uid`, which
works fine in MySQL but might lead to problems when working with
stricter DBMS.

Such an example of a DBMS not liking the update of an identity field,
is SQL Server.

Now, I know that SQL Server will not be supported in TYPO3 v12 going
onward, but on the off-chance that somebody has another DBMS than MySQL
or has DBMS that will break when trying to update an identify field,
this bugfix might still be valuable.

The bug exists back to TYPO3 10 at least.

Releases: main, 12.4, 11.5
Resolves: #100175
Change-Id: Id4dd90579191da0cb770490256087209e749deb4
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80068
Tested-by: Stefan B�rk <stefan@buerk.tech>
Reviewed-by: Stefan B�rk <stefan@buerk.tech>
Tested-by: core-ci <typo3@b13.com>
  • Loading branch information
Tizian Schmidlin authored and sbuerk committed Jul 21, 2023
1 parent 2e01494 commit bba7882
Showing 1 changed file with 1 addition and 0 deletions.
Expand Up @@ -205,6 +205,7 @@ public function update($processedFile)
if ($processedFile->isPersisted()) {
$uid = (int)$processedFile->getUid();
$updateFields = $this->cleanUnavailableColumns($processedFile->toArray());
unset($updateFields['uid']);
$updateFields['tstamp'] = time();

$connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable($this->table);
Expand Down

0 comments on commit bba7882

Please sign in to comment.