Project

General

Profile

Actions

Bug #89848

closed

Database Analyzer crashes with undefined enum fields

Added by Richard Haeser over 5 years ago. Updated 3 months ago.

Status:
Resolved
Priority:
Should have
Assignee:
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2019-12-04
Due date:
% Done:

100%

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

Description

When you have a field in a column of type enum that is not specified in a sql file in the installation, the Database Analyzer in the install tool will crash and throws the error "array_map(): Argument #2 should be an array in /var/www/html/typo3/sysext/core/Classes/Database/Schema/Types/EnumType.php line 38". When you have the definition in a sql file of an extension, this won't cause an issue.

How to reproduce:
- Create a new field in tt_content with type enum and some values and a random name
- Go to Database Analyzer in install tool and run it


Files

Annotation 2019-12-05 151443.png (18.9 KB) Annotation 2019-12-05 151443.png Susanne Moog, 2019-12-05 15:15

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Task #100277: Introduce DatabaseType enumClosedAlexander Schnitzler2023-03-23

Actions
Related to TYPO3 Core - Bug #97498: MariaDB + enum field generates endless DB comparison loop due to wrong/twice string escaping of default valueClosed2022-04-28

Actions
Actions #1

Updated by Susanne Moog over 5 years ago

Hmm, I did:

alter table tt_content
    add foobar enum('foo', 'bar') null;

Result - see attached screenshot. Database Analyzer is fine.

Actions #2

Updated by Richard Haeser over 5 years ago

Just executed your SQL and I get in the database analyzer:

TYPO3\CMS\Core\Error\ErrorHandler->handleError(2, 'array_map(): Argument #2 should be an array', '/var/www/html/typo3/sysext/core/Classes/Database/Schema/Types/EnumType.php', 38, array('fieldDeclaration' => array('name' => 'zzz_deleted_foobar', 'type' => object(TYPO3\CMS\Core\Database\Schema\Types\EnumType), 'default' => 'NULL', 'notnull' => false, 'length' => null, 'precision' => 10, 'scale' => 0, 'fixed' => false, 'unsigned' => false, 'autoincrement' => false, 'columnDefinition' => null, 'comment' => ''), 'platform' => object(Doctrine\DBAL\Platforms\MariaDb1027Platform)))

MariaDB: 10.2
Default DDEV setup (v1.11)

Actions #3

Updated by Richard Haeser over 5 years ago

When I change \TYPO3\CMS\Core\Database\Schema\Types\EnumType::getSQLDeclaration to make sure an array is always forced, I get the same result as you. But try to execute that update command ;-)

Actions #4

Updated by Gerrit Code Review over 5 years ago

  • Status changed from Needs Feedback to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62543

Actions #5

Updated by Joerg Kummer about 4 years ago

Confirmed

Actions #6

Updated by Gerrit Code Review about 4 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62543

Actions #7

Updated by Markus Klein 8 months ago

  • Related to Task #100277: Introduce DatabaseType enum added
Actions #8

Updated by Markus Klein 8 months ago

  • Related to Bug #97498: MariaDB + enum field generates endless DB comparison loop due to wrong/twice string escaping of default value added
Actions #9

Updated by Stefan Bürk 8 months ago

  • Assignee set to Stefan Bürk
Actions #10

Updated by Gerrit Code Review 3 months ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87524

Actions #11

Updated by Stefan Bürk 3 months ago

The descibed issue manifested within the custom EnumType implementation
of TYPO3 as symptom but the root cause layed in Doctrine DBAL itself.

This has been accidently fixed in Doctrine DBAL 3.5.0 [1] and curretly
community supported TYPO3 version in the latest version are safe.

Some tests should be added to cover this and to close this issue.

Fixes for TYPO3 v11 or earlier are not provided due to beeing ELTS.

Actions #12

Updated by Stefan Bürk 3 months ago

  • TYPO3 Version changed from 10 to 12
Actions #13

Updated by Gerrit Code Review 3 months ago

Patch set 1 for branch 13.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87532

Actions #14

Updated by Gerrit Code Review 3 months ago

Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/87533

Actions #15

Updated by Stefan Bürk 3 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF