Skip to content

Commit

Permalink
[Open311] Make sure empty group stored as string.
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed Sep 14, 2023
1 parent 64544fb commit 40eae00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions perllib/Open311/PopulateServiceList.pm
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,12 @@ sub _get_new_groups {
return [] unless $self->_current_body_cobrand && $self->_current_body_cobrand->enable_category_groups;

my $groups = $self->_current_service->{groups} || [];
my @groups = map { Utils::trim_text($_) } @$groups;
my @groups = map { Utils::trim_text($_ || '') } @$groups;
return \@groups if @groups;

my $group = $self->_current_service->{group} || [];
$group = [] if @$group == 1 && !$group->[0]; # <group></group> becomes [undef]...
@groups = map { Utils::trim_text($_) } @$group;
@groups = map { Utils::trim_text($_ || '') } @$group;
return \@groups;
}

Expand Down

0 comments on commit 40eae00

Please sign in to comment.