aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2019-11-12 16:29:00 +0000
committerDave Arter <davea@mysociety.org>2019-12-09 12:50:07 +0000
commit348521a188009bb6f90116a4394ab2f955ee13e4 (patch)
treeb4f110733c273b7ec32bb4638dc4dd75cd84ee71
parent46042546c2eae542f47fbb2a0b17ce302750adb6 (diff)
[TfL] Call Other "Other (TfL)" for interop.
-rwxr-xr-xbin/tfl/import_categories4
-rw-r--r--web/cobrands/tfl/assets.js1
2 files changed, 4 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_",
diff --git a/web/cobrands/tfl/assets.js b/web/cobrands/tfl/assets.js
index 832f3c875..fe12b015c 100644
--- a/web/cobrands/tfl/assets.js
+++ b/web/cobrands/tfl/assets.js
@@ -76,6 +76,7 @@ var tlrn_categories = [
"Manhole Cover - Damaged (rocking or noisy)",
"Manhole Cover - Missing",
"Mobile Crane Operation",
+ "Other (TfL)",
"Pavement Defect (uneven surface / cracked paving slab)",
"Pothole",
"Roadworks",