aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-10-02 14:03:58 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-10-02 14:03:58 +0100
commit1991fc6e914a3f11c61358a59322280dee4b90eb (patch)
tree747d784a09f92e4414666cb1a2c3137a8ffc2b38
parent85293da04381215fbf8384ec2e8d99d9862d6129 (diff)
[Zurich] Ignore deleted categories on change.
This led to an odd issue whereby a deleted category started being used for a category change, but only when the other category with the same name was edited (so thus changed the database's internal ordering).
-rw-r--r--perllib/FixMyStreet/Cobrand/Zurich.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm
index 1d219ce37..7a54fe0d5 100644
--- a/perllib/FixMyStreet/Cobrand/Zurich.pm
+++ b/perllib/FixMyStreet/Cobrand/Zurich.pm
@@ -651,7 +651,7 @@ sub admin_report_edit {
&& $new_cat
&& $new_cat ne $problem->category
) {
- my $cat = $c->model('DB::Contact')->search({ category => $c->get_param('category') } )->first;
+ my $cat = $c->model('DB::Contact')->not_deleted->search({ category => $c->get_param('category') } )->first;
my $old_cat = $problem->category;
$problem->category( $new_cat );
$problem->external_body( undef );