Bug #89713
closed
TCA check ignores PHP constants
Added by Franz Holzinger over 4 years ago.
Updated over 4 years ago.
Sprint Focus:
Needs Decision
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
- 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.
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.
- Status changed from Needs Feedback to Under Review
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Sprint Focus changed from PRC to Needs Decision
- Status changed from Resolved to Closed
- Related to Bug #91073: Install Tool: Check TCA action does not provide symfony container when loading ext_localconf files added
Also available in: Atom
PDF