Bug #99261
closed
Undefined array key 0 in ConnectionMigrator.php
Added by Alex Kellner almost 2 years ago.
Updated almost 2 years ago.
Category:
Database API (Doctrine DBAL)
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
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;
}
- Related to Bug #98707: Add temporarily workaround for changed doctrine/dbal behaviour added
- 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.
- Status changed from Resolved to Closed
Also available in: Atom
PDF