Project

General

Profile

Actions

Bug #99261

closed

Undefined array key 0 in ConnectionMigrator.php

Added by Alex Kellner about 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2022-12-03
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

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


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #98707: Add temporarily workaround for changed doctrine/dbal behaviourClosedStefan Bürk2022-10-23

Actions
Actions #1

Updated by Markus Bischof about 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;
    }
Actions #2

Updated by Stefan Bürk about 2 years ago

  • Related to Bug #98707: Add temporarily workaround for changed doctrine/dbal behaviour added
Actions #3

Updated by Stefan Bürk about 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.

Actions #4

Updated by Stefan Bürk about 2 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF