#102041fix error message: Invalid TCA internal_type set to folder
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:
Reviews 1
History 910
-
Oliver Bartsch commented and changed status
NewNeeds Feedback 10/02/23, 09:42Hi, the exception should suggest a correct value to inform the developer how to avoid / resolve the exception. would not be valid because only “db” and “folder” are valid in v11. -
Franz Holzinger commented 10/02/23, 09:48
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.’, -
Oliver Bartsch commented 10/04/23, 13:28
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 -
Franz Holzinger commented 10/04/23, 15:38
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. -
Gerrit Code Review pushed patch set 1 for 11.5 to change 81324 status
Needs FeedbackUnder Review 10/05/23, 09:53 -
Oliver Bartsch commented and changed status
Under ReviewNeeds Feedback 10/05/23, 09:55Oke, 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.
-
Oliver Bartsch changed status
Needs FeedbackUnder Review 10/05/23, 09:55 -
Oliver Bartsch commented and changed status
Under ReviewResolved done0 %100 % 10/05/23, 10:05Applied in changeset commit:d5076dfac980968654cf248dcf5a112b90a13c3c.
-
Franz Holzinger commented 10/05/23, 13:10
Is there a TCA migration tool available for all extensions who come into this error?
-
Benni Mack changed status
ResolvedClosed 07/09/24, 15:19