Skip to content

Commit

Permalink
2.20.13 Prevented 'Unknown' as an RWW Region Focus (we always know wh…
Browse files Browse the repository at this point in the history
…ere listeners are)
  • Loading branch information
classaxe committed Sep 27, 2020
1 parent 5c8de1e commit 1d200d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Form/Signals/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public function buildForm(FormBuilderInterface $formBuilder, array $options)
'rww_focus',
ChoiceType::class,
[
'choices' => $this->regionRepository->getAllOptions(),
'choices' => $this->regionRepository->getAllOptions(false),
'data' => $options['rww_focus'],
'label' => 'RWW Focus',
'required' => false
Expand Down
5 changes: 4 additions & 1 deletion src/Repository/RegionRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ public function get($code)
->getSingleResult();
}

public function getAllOptions()
public function getAllOptions($withUnknown = true)
{
$regions = $this->getRegions();
$out = ['(All Regions)' => ''];
foreach ($regions as $row) {
if ($withUnknown === false && $row->getRegion() === 'xx') {
continue;
}
$out[$row->getName()] = $row->getRegion();
}
return $out;
Expand Down

0 comments on commit 1d200d3

Please sign in to comment.