Project

General

Profile

Actions

Bug #102041

closed

fix error message: Invalid TCA internal_type set to folder

Added by Franz Holzinger about 1 year ago. Updated 5 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2023-09-26
Due date:
% Done:

100%

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

Description

If an older version of an extension uses a TCA "group" of a type different to "db" and "folder", then an Exception is thrown with a wrong error message:

Invalid TCA internal_type of field "images" in table tt_content: Must not be set, or set to "folder".

The correct error message should have been like this:

Invalid TCA internal_type of field "images" in table tt_content: Must not be set, or set to "file".

See the file 'TYPO3/typo3_src-11.5.31/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaGroup.php' line 151.

throw new \UnexpectedValueException(
'Invalid TCA internal_type of field "' . $fieldName . '" in table ' . $result['tableName']
. ': Must not be set, or set to "folder".',
1438780511
);
}

==>

. ': Must not be set, or set to "' . $internalType . '".',

see also deprecation notice:

https://docs.typo3.org/m/typo3/reference-tca/11.5/en-us/ColumnsConfig/Type/Group/Properties/InternalType.html

Actions #1

Updated by Oliver Bartsch about 1 year ago

  • Status changed from New to Needs Feedback

Hi, the exception should suggest a correct value to inform the developer how to avoid / resolve the exception.

or set to "file"
would not be valid because only "db" and "folder" are valid in v11.

Actions #2

Updated by Franz Holzinger about 1 year ago

Hm, then this error message is really confusing at the moment, because it says: ".... must not be set to folder ." However this is wrong, because it should be set to "folder".

New proposal:

. ': Must not be set to "' . $internalType . '". Try to use "folder" instead.',
Actions #3

Updated by Oliver Bartsch about 1 year ago

Could you please check the current message again. AFAICS it currently already reads this way: Must not be set, or set to "folder", see https://github.com/TYPO3/typo3/blob/v11.5.31/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaGroup.php#L152

Actions #4

Updated by Franz Holzinger about 1 year ago

But the current error message is so confusing. It uses a comma inside of the sentence. I always understood it that 'folder' has not been allowed.
It does not even show you what is currently set. So a user has no chance to easily search for the 'type' in his extension's PHP and XML code.

Actions #5

Updated by Gerrit Code Review about 1 year ago

  • Status changed from Needs Feedback to Under Review

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

Actions #6

Updated by Oliver Bartsch about 1 year ago

  • Status changed from Under Review to Needs Feedback

Oke, this only targets 11.5 since in v12 we don't have this exception anymore and a TCA Migration is in place. I would be happy if you could check corresponding patch https://review.typo3.org/c/Packages/TYPO3.CMS/+/81324.

Actions #7

Updated by Oliver Bartsch about 1 year ago

  • Status changed from Needs Feedback to Under Review
Actions #8

Updated by Oliver Bartsch about 1 year ago

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

Updated by Franz Holzinger about 1 year ago

Is there a TCA migration tool available for all extensions who come into this error?

Actions #10

Updated by Benni Mack 5 months ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF