Skip to content

Fix an intermittent bootstrap failure after cache purges#78

Open
frederikmillingpytlick wants to merge 2 commits into
catalyst:MOODLE_405_STABLEfrom
praxisdigital:MOODLE_405_STABLE
Open

Fix an intermittent bootstrap failure after cache purges#78
frederikmillingpytlick wants to merge 2 commits into
catalyst:MOODLE_405_STABLEfrom
praxisdigital:MOODLE_405_STABLE

Conversation

@frederikmillingpytlick

@frederikmillingpytlick frederikmillingpytlick commented Jun 11, 2026

Copy link
Copy Markdown

During tool_forcedcache_cache_factory::create_config_instance(), cache config loading can re-enter Moodle cache setup and reset the factory’s internal $configs array. The method then attempted to return $this->configs[$class], which could emit an undefined array key warning and return null, leading to:
Call to a member function get_definition_by_id() on null

This patch keeps the newly created config instance in a local variable, loads it, then re-registers it in $this->configs after load completes. That makes the method robust if $this->configs is reset during config generation.

Tested with:

php admin/cli/purge_caches.php
php admin/cli/purge_caches.php
php admin/cli/purge_caches.php

It doesn't seem to be an issue in the MOODLE_501_STABLE branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant