Bug #67763
closedCache: Undefined class constant PATTERN_ENTRYIDENTIFIER
100%
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.
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
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.
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?
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
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 :-(
Updated by Helmut Hummel over 9 years ago
- Status changed from Rejected to Accepted
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.
Updated by Helmut Hummel over 9 years ago
- Status changed from Accepted to Needs Feedback
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
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
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
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
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
Updated by Helmut Hummel over 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 1752a39139d72fadd46aa636195bd51b1cf4c711.
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
Updated by Wouter Wolters about 9 years ago
- Status changed from Under Review to Closed