diff --git a/classes/cache_config.php b/classes/cache_config.php index a6a66fe..5294311 100644 --- a/classes/cache_config.php +++ b/classes/cache_config.php @@ -297,7 +297,7 @@ private function generate_mode_mapping($rules): array { // Check if the rule has any conditions, if not it will be set // as the default store as it is considered the broadest rule. if (empty($lastrule['conditions'])) { - $modemapping['store'] = $lastrule['stores']; + $modemapping['store'] = reset($lastrule['stores']); } } return $modemapping; diff --git a/tests/fixtures/mode_mappings_data.php b/tests/fixtures/mode_mappings_data.php index f49d110..5164d9b 100644 --- a/tests/fixtures/mode_mappings_data.php +++ b/tests/fixtures/mode_mappings_data.php @@ -37,9 +37,7 @@ $generatedmodemappingagainstdefinitionmatchtoprulesetexpected = array( array( 'mode' => cache_store::MODE_APPLICATION, - 'store' => array( - 'file-test' - ), + 'store' => 'file-test', 'sort' => -1 ), array(