diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/tfl/import_categories | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/tfl/import_categories b/bin/tfl/import_categories index b1cf23114..bb48ddc4e 100755 --- a/bin/tfl/import_categories +++ b/bin/tfl/import_categories @@ -53,6 +53,7 @@ my $groups = $config->{groups}; for my $group (keys %$groups) { my $cats = $groups->{$group}; for my $cat (@$cats) { + $cat->{category} = 'Other (TfL)' if $cat->{category} eq 'Other'; my $child_cat = FixMyStreet::DB->resultset("Contact")->find_or_new({ body => $body, category => $cat->{category} @@ -62,13 +63,14 @@ for my $group (keys %$groups) { $child_cat->editor($0); $child_cat->whenedited(\'current_timestamp'); $child_cat->note($child_cat->in_storage ? 'Updated by import_categories' : 'Created by import_categories'); - say colored("WARNING", 'red') . " " . $child_cat->category . " already exists" if $child_cat->in_storage and $child_cat->category ne 'Other'; + say colored("WARNING", 'red') . " " . $child_cat->category . " already exists" if $child_cat->in_storage and $child_cat->category ne 'Other (TfL)'; my $groups = $child_cat->groups; my %groups = map { $_ => 1} @$groups; $groups{$group} = 1; my @groups = keys %groups; $child_cat->extra(undef) if $child_cat->in_storage; $child_cat->set_extra_metadata(group => \@groups); + $child_cat->set_extra_metadata(display_name => 'Other') if $child_cat->category eq 'Other (TfL)'; if ($cat->{disable}) { $child_cat->update_extra_field({ code => "_fms_disable_", |