Skip to content

Commit

Permalink
Bugfix for store allocation array, now returns string element
Browse files Browse the repository at this point in the history
  • Loading branch information
Peterburnett committed Nov 11, 2021
1 parent 90d5809 commit db9a83e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion classes/cache_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 1 addition & 3 deletions tests/fixtures/mode_mappings_data.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@
$generatedmodemappingagainstdefinitionmatchtoprulesetexpected = array(
array(
'mode' => cache_store::MODE_APPLICATION,
'store' => array(
'file-test'
),
'store' => 'file-test',
'sort' => -1
),
array(
Expand Down

0 comments on commit db9a83e

Please sign in to comment.