Issue Bug Closed

#102041fix error message: Invalid TCA internal_type set to folder

Franz Holzinger 09/26/23, 17:39 updated 07/09/24, 15:19

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

Reviews 1

History 910

  1. Oliver Bartsch commented and changed status New Needs Feedback 10/02/23, 09:42

    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.
  2. 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.’,
  3. 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

  4. 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.

  5. Gerrit Code Review pushed patch set 1 for 11.5 to change 81324 status Needs Feedback Under Review 10/05/23, 09:53

  6. Oliver Bartsch commented and changed status Under Review Needs Feedback 10/05/23, 09:55

    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.

  7. Oliver Bartsch changed status Needs Feedback Under Review 10/05/23, 09:55

  8. Oliver Bartsch commented and changed status Under Review Resolved done 0 % 100 % 10/05/23, 10:05

    Applied in changeset commit:d5076dfac980968654cf248dcf5a112b90a13c3c.

  9. Franz Holzinger commented 10/05/23, 13:10

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

  10. Benni Mack changed status Resolved Closed 07/09/24, 15:19