MDL-42012 cache: Allow data sources to work when caching is disabled
[moodle.git] / cache / classes / factory.php
index 9abfe0e..07d7b35 100644 (file)
@@ -449,7 +449,8 @@ class cache_factory {
                         $definition = $instance->get_definition_by_id($id);
                         if (!$definition) {
                             throw new coding_exception('The requested cache definition does not exist.'. $id, $id);
-                        } else if (!$this->is_disabled()) {
+                        }
+                        if (!$this->is_disabled() && !($this instanceof cache_factory_disabled)) {
                             debugging('Cache definitions reparsed causing cache reset in order to locate definition.
                                 You should bump the version number to ensure definitions are reprocessed.', DEBUG_DEVELOPER);
                         }