Bug #89713
closedTCA check ignores PHP constants
100%
Description
The TYPO3 9 module "TCA check" fails to check the TCA files in Configuration/TCA or ext_tables.php if PHP constants are used. The PHP constants have been defined in the file ext_localconf.php of the extension.
example:
(1/1) #1476107295 TYPO3\CMS\Core\Error\Exception
PHP Warning: Use of undefined constant DIV2007_EXT - assumed 'DIV2007_EXT' (this will throw an Error in a future version of PHP) in /homepages/mypath/typo3conf/ext/div2007/ext_tables.php line 7
Updated by Susanne Moog over 4 years ago
- Status changed from New to Needs Feedback
Hi and thanks for the report,
just to make sure I get that right:
- you are defining constants in the ext_localconf
- you are using these constants everywhere else?
Does it mean that your code has interdependencies (the ext_tables / TCA files are not able to be loaded independently?)?
If so, I'd suggest to add a check on the constants existence to the ext_tables part if possible.
Updated by Franz Holzinger over 4 years ago
Yes, the constants are defined in the file ext_localconf.php and they are needed in many other files.
Yes, it is possible to add a check about the constants in the TCA files (ext_tables.php has almost no content any more). and redefine the constants there.
However this is a bad practice. I have to define the same constants 13 times, if an extension which has 12 TCA files. So I have duplicate code.
Only the check for TCA fails to get the constants from the file ext_localconf.php.
Updated by Gerrit Code Review over 4 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/+/63801
Updated by Gerrit Code Review over 4 years ago
Patch set 1 for branch 9.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/+/63778
Updated by Andreas Fernandez over 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset eefd63fe3e2cd5b17c5bdfc3073a38878e693439.
Updated by Benni Mack over 4 years ago
- Sprint Focus changed from PRC to Needs Decision
Updated by Benjamin Franzke over 4 years ago
- Related to Bug #91073: Install Tool: Check TCA action does not provide symfony container when loading ext_localconf files added