Bug #99261
closedUndefined array key 0 in ConnectionMigrator.php
0%
Description
I just installad a 12.0 of TYPO3 and wanted to do a db compare. This must be done with the "install tool" backend module and is not doable over CLI (what a pitty).
When pressing the "analyze" button, this error happened:
PHP Warning: Undefined array key 0 in .../public/typo3/sysext/core/Classes/Database/Schema/ConnectionMigrator.php line 683
TYPO3 12.0.0 with PHP 8.1.13
Updated by Markus Bischof almost 2 years ago
Same here. The problem occurs if you try to rename a table (e.g. to zzz_deleted_XXX before the table is really removed). TYPO3 uses the deprecated name/newName properties of Doctrines TableDiff class. While processing changed tables the isEmpty method of TableDiff is used which (no longer) respects the name/newName properties.
Regarding to the Doctrine docs AbstractSchemaManager::renameTable() should be used.
You can either downgrade to Doctrine 3.4.x or patch Doctrines TableDiff::isEmpty() method to respect the newName property
/** * Returns whether the diff is empty (contains no changes). */ public function isEmpty(): bool { return $this->newName === false && count($this->addedColumns) === 0 && count($this->changedColumns) === 0 && count($this->removedColumns) === 0 && count($this->renamedColumns) === 0 && count($this->addedIndexes) === 0 && count($this->changedIndexes) === 0 && count($this->removedIndexes) === 0 && count($this->renamedIndexes) === 0 && count($this->addedForeignKeys) === 0 && count($this->changedForeignKeys) === 0 && count($this->removedForeignKeys) === 0; }
Updated by Stefan Bürk almost 2 years ago
- Related to Bug #98707: Add temporarily workaround for changed doctrine/dbal behaviour added
Updated by Stefan Bürk almost 2 years ago
- Category set to Database API (Doctrine DBAL)
- Status changed from New to Resolved
- Assignee set to Stefan Bürk
This has been already fixed in main with #98707, but sadly this
was after 12.0 release. Comes with 12.1 then.
If you are using composer you could composer patch it if you need
it before 12.1 release.
https://review.typo3.org/c/Packages/TYPO3.CMS/+/76232
Setting this to resolved for now and will close this issue in some
days.
Updated by Stefan Bürk almost 2 years ago
- Status changed from Resolved to Closed