Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
Merge pull request #2447 from ymcatwincities/9.x-2.x-issue2445
Browse files Browse the repository at this point in the history
Fix for Locations Filter
  • Loading branch information
podarok authored May 5, 2021
2 parents 6ca0d3c + a1b8c66 commit 88c2a57
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,15 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
/** @var \Drupal\Core\Config\Config $config */
$config = $this->config(self::CONFIG_NAME);
$locations = $form_state->getValue('locations');
if (isset($locations['All'])) {
$branches_list = $this->getBranchesList();
$locations = $branches_list['branch'] + $branches_list['camp'];

foreach ($locations as $id => $status) {
if ($id != 'All' && $status == $id) {
$new_locations[$id] = $status;
}
}
$config->set('locations', $locations)->save();

$config->set('locations', $new_locations)->save();

Cache::invalidateTags(['rendered']);

parent::submitForm($form, $form_state);
Expand Down

0 comments on commit 88c2a57

Please sign in to comment.