Project

General

Profile

Actions

Bug #67763

closed

Cache: Undefined class constant PATTERN_ENTRYIDENTIFIER

Added by Aimeos no-lastname-given over 9 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
Caching
Target version:
-
Start date:
2015-06-26
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.5
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

After installing TYPO3 7.3 and the Aimeos extension, we constantly get the following fatal error:

PHP Fatal error:  Undefined class constant 'PATTERN_ENTRYIDENTIFIER' in typo3/sysext/core/Classes/Cache/Frontend/AbstractFrontend.php on line 53

The problem seems that the PATTERN_ENTRYIDENTIFIER constant has been moved to the typo3/sysext/core/Classes/Cache/Frontend/FrontendInterface.php, but is referred in the contructor of the typo3/sysext/core/Classes/Cache/Frontend/AbstractFrontend.php as self::PATTERN_ENTRYIDENTIFIER. The Aimeos extension doesn't refer to PATTERN_ENTRYIDENTIFIER at all, so it seems to be not the source of the problem.

Actions #1

Updated by Gerrit Code Review over 9 years ago

  • Status changed from New 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 http://review.typo3.org/40670

Actions #2

Updated by Andreas Kienast over 9 years ago

  • Status changed from Under Review to Rejected

As fas as I can see, it's not a bug in TYPO3 but in the extension itself: The file /Resources/Extensions/ai-typo3/lib/custom/tests/MW/Cache/T3Cache.php gets autoloaded and overrides FrontendInterface, so the class constant gets obviously lost. This happens because the namespace TYPO3\CMS\Core\Cache\Frontend is defined here which is highly discouraged.

I will close this ticket, as it's not a core bug. If you feel wrong about this decision, please contact me and the ticket will be opened again.

Actions #3

Updated by Aimeos no-lastname-given over 9 years ago

You are right, there's some relationship between the T3Cache test class and the problem I've described.

But the real problem seems to be that this file is added to the typo3temp/autoload/autoload_classmap.php and loaded at all. Until 7.3, only the relevant files from our Aimeos extensions (listed in their composer.json file, not test files) were loaded by our custom autoloader.

If we remove it, we can't test the extension on travis-ci any more. How can we solve this?

Actions #4

Updated by Helmut Hummel over 9 years ago

Aimeos no-lastname-given wrote:

If we remove it, we can't test the extension on travis-ci any more. How can we solve this?

for the time being, use a different (non conflicting) namespace for your test class

Actions #5

Updated by Aimeos no-lastname-given over 9 years ago

That doesn't work because in order to enforce the interface for the constructor parameter it must be of type \TYPO3\CMS\Core\Cache\Frontend\FrontendInterface.

We've also thought about encapsulating the test class and the emtpy interface into a "if" condition and load the class only if it's not loaded before but then it will depend on if the real class is really loaded first. This might lead to even harder to detect errors :-(

Actions #6

Updated by Helmut Hummel over 9 years ago

  • Status changed from Rejected to Accepted
Actions #7

Updated by Helmut Hummel over 9 years ago

Aimeos no-lastname-given wrote:

That doesn't work because in order to enforce the interface for the constructor parameter it must be of type \TYPO3\CMS\Core\Cache\Frontend\FrontendInterface.

We've also thought about encapsulating the test class and the emtpy interface into a "if" condition and load the class only if it's not loaded before but then it will depend on if the real class is really loaded first. This might lead to even harder to detect errors :-(

Where can I have a look at the code of the extension and what is the exact location of that file?

You can btw. create classes with eval instead of including files.

Anyway, we may be able to fix this, if you provide additional information.

Actions #8

Updated by Helmut Hummel over 9 years ago

  • Status changed from Accepted to Needs Feedback
Actions #9

Updated by Helmut Hummel over 9 years ago

Aimeos no-lastname-given wrote:

That doesn't work because in order to enforce the interface for the constructor parameter it must be of type \TYPO3\CMS\Core\Cache\Frontend\FrontendInterface.

Well. Thinking about that again: what exactly do you mean?

Just create a mock from the plain (existing interface) and you should be fine. you don't need the fixture you created at all

Actions #10

Updated by Gerrit Code Review over 9 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 http://review.typo3.org/40966

Actions #11

Updated by Gerrit Code Review over 9 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40966

Actions #12

Updated by Gerrit Code Review over 9 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40966

Actions #13

Updated by Gerrit Code Review over 9 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40966

Actions #14

Updated by Helmut Hummel over 9 years ago

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

Updated by Gerrit Code Review over 9 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_7-3 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/41419

Actions #16

Updated by Markus Sommer about 9 years ago

  • Assignee set to Georg Ringer
Actions #17

Updated by Wouter Wolters about 9 years ago

  • Status changed from Under Review to Closed
Actions

Also available in: Atom PDF