Bug #88775

logger in ApcuBackend is not instantiated

Added by Thomas Kieslich 3 months ago. Updated 2 months ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Caching
Target version:
-
Start date:
2019-07-16
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

$this->logger in Line 139 is never instantiated and i got this Error in Log:

Core: Exception handler (WEB): Uncaught TYPO3 Exception: Call to a member function alert() on null | Error thrown in file /html/de.frosta.production/public/typo3/sysext/core/Classes/Cache/Backend/ApcuBackend.php in line 139


Related issues

Related to TYPO3 Core - Bug #88938: wrong class statement for logger initialization Resolved 2019-08-08
Duplicates TYPO3 Core - Bug #87820: Logger not instanciated in cache backend Resolved 2019-03-01

Associated revisions

Revision 524b6701 (diff)
Added by Anja Leichsenring 2 months ago

[BUGFIX] Instantiate Logger on cache backend creation

Cache backends are created via new, not using GU::makeInstance.
So it happened no cache has been initialized, causing errors upon
calls for the logger.
Putting cache creation into the cache backend constructor solves
the problem and makes sure the logger is always available.

Resolves: #88775
Resolves: #87820
Releases: master, 9.5
Change-Id: I4005b812e96c028528f3740c581b8086cfc592f0
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61472
Tested-by: TYPO3com <>
Tested-by: Frank Naegler <>
Tested-by: Andreas Fernandez <>
Reviewed-by: Frank Naegler <>
Reviewed-by: Andreas Fernandez <>

Revision 81879885 (diff)
Added by Anja Leichsenring 2 months ago

[BUGFIX] Instantiate Logger on cache backend creation

Cache backends are created via new, not using GU::makeInstance.
So it happened no cache has been initialized, causing errors upon
calls for the logger.
Putting cache creation into the cache backend constructor solves
the problem and makes sure the logger is always available.

Resolves: #88775
Resolves: #87820
Releases: master, 9.5
Change-Id: I4005b812e96c028528f3740c581b8086cfc592f0
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61460
Tested-by: TYPO3com <>
Tested-by: Andreas Fernandez <>
Reviewed-by: Andreas Fernandez <>

History

#1 Updated by Daniel Windloff 3 months ago

The class \TYPO3\CMS\Core\Cache\Backend\AbstractBackend implements the LoggerAwareInterface and the LoggerAwareTrait.

But caching backend instances are created via "new" and not via GeneralUtility::makeInstance (see CacheManger:329).
So the logger is not set atm. This also affects the RedisBackend and the MemcachedBackend.

#2 Updated by Georg Ringer 3 months ago

  • Status changed from New to Accepted

#3 Updated by Daniel Windloff 3 months ago

  • Duplicates Bug #87820: Logger not instanciated in cache backend added

#4 Updated by Gerrit Code Review 2 months ago

  • Status changed from Accepted 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/+/61472

#5 Updated by Gerrit Code Review 2 months ago

Patch set 2 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/+/61472

#6 Updated by Gerrit Code Review 2 months ago

Patch set 3 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/+/61472

#7 Updated by Gerrit Code Review 2 months ago

Patch set 4 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/+/61472

#8 Updated by Gerrit Code Review 2 months 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/+/61460

#9 Updated by Anja Leichsenring 2 months ago

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

#10 Updated by Anja Leichsenring 2 months ago

  • Related to Bug #88938: wrong class statement for logger initialization added

Also available in: Atom PDF