Bug #89713

TCA check ignores PHP constants

Added by Franz Holzinger over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2019-11-19
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.3
Tags:
Complexity:
Is Regression:
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

Related issues

Related to TYPO3 Core - Bug #91073: Install Tool: Check TCA action does not provide symfony container when loading ext_localconf filesClosed2020-04-17

Actions
#1

Updated by Susanne Moog over 1 year 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.

#2

Updated by Franz Holzinger over 1 year 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.

#3

Updated by Georg Ringer over 1 year ago

  • Sprint Focus set to PRC
#4

Updated by Gerrit Code Review over 1 year 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

#5

Updated by Gerrit Code Review about 1 year 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

#6

Updated by Andreas Fernandez about 1 year ago

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

Updated by Benni Mack about 1 year ago

  • Sprint Focus changed from PRC to Needs Decision
#8

Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed
#9

Updated by Benjamin Franzke about 1 year ago

  • 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