Skip to content

Errors while clearing the cache #347

@theuros

Description

@theuros

Сообщение об ошибке / Error message

Modx console on clearing the cache outputs:
PHP warning: Undefined property: MODX\Revolution\modX::$service

PHP error log:
[26-Jul-2022 08:14:28 UTC] PHP Fatal error: Uncaught Error: Call to a member function get() on null in /www/core/cache/includes/elements/modx/revolution/modplugin/2.include.cache.php:7 Stack trace: #0 /www/core/src/Revolution/modScript.php(88): include() #1 /www/core/src/Revolution/modX.php(1706): MODX\Revolution\modScript->process() #2 /www/core/src/Revolution/Processors/System/ClearCache.php(48): MODX\Revolution\modX->invokeEvent() #3 /www/core/src/Revolution/Processors/Processor.php(189): MODX\Revolution\Processors\System\ClearCache->process() #4 /www/core/src/Revolution/modX.php(1771): MODX\Revolution\Processors\Processor->run() #5 /www/core/src/Revolution/modConnectorResponse.php(151): MODX\Revolution\modX->runProcessor() #6 /www/core/src/Revolution/modConnectorRequest.php(89): MODX\Revolution\modConnectorResponse->outputContent() #7 /www/core/src/Revolution/modConnectorRequest.php(77): MODX\Revolution\modConnectorRequest->prepareResponse() #8 /www/connectors/index.php(79): MODX\Revolution\modConnectorRequest->handleRequest() #9 {main} thrown in /www/core/cache/includes/elements/modx/revolution/modplugin/2.include.cache.php on line 7

Plugin with id 2 in error is "pdoTools" and line 7 is:
if ($coreTools = $modx->service->get('pdotools')) { ... }

Резюме / Summary

After updating pdoTools to 3.0.0-pl I noticed errors when trying to clear modx cache in manager.

Шаг для воспроизведения / Step to play

Clear modx cache in manager

Наблюдаемое поведение / Observed behavior

Cache is not cleared and modx console outputs error:
PHP warning: Undefined property: MODX\Revolution\modX::$service

Ожидаемое поведение / Expected behavior

No error while clearing modx cache

Environment

Modx 3.0.1-pl
PHP 8.1
Nginx
Hosted on modx cloud

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions