Project

General

Profile

Actions

Bug #102041

closed

fix error message: Invalid TCA internal_type set to folder

Added by Franz Holzinger 7 months ago. Updated 7 months ago.

Status:
Resolved
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 7 months 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 7 months 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 7 months 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 7 months 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 7 months 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 7 months 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 7 months ago

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

Updated by Oliver Bartsch 7 months ago

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

Updated by Franz Holzinger 7 months ago

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

Actions

Also available in: Atom PDF