Project

General

Profile

Actions

Bug #89713

closed

TCA check ignores PHP constants

Added by Franz Holzinger over 4 years ago. Updated about 4 years 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 1 (0 open1 closed)

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

Actions
Actions #1

Updated by Susanne Moog about 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.

Actions #2

Updated by Franz Holzinger about 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.

Actions #3

Updated by Georg Ringer about 4 years ago

  • Sprint Focus set to PRC
Actions #4

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

Actions #5

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

Actions #6

Updated by Andreas Fernandez about 4 years ago

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

Updated by Benni Mack about 4 years ago

  • Sprint Focus changed from PRC to Needs Decision
Actions #8

Updated by Benni Mack about 4 years ago

  • Status changed from Resolved to Closed
Actions #9

Updated by Benjamin Franzke about 4 years ago

  • Related to Bug #91073: Install Tool: Check TCA action does not provide symfony container when loading ext_localconf files added
Actions

Also available in: Atom PDF