aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--perllib/FixMyStreet/App/Controller/Around.pm11
2 files changed, 8 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a0a3d2d5d..901fe2dae 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,7 @@
* Unreleased
- New features:
- Dashboard now has update CSV export. #2249
+ - Allow cobrands to override searching by reference #2271
- Front end improvements:
- Clearer relocation options while you’re reporting a problem #2238
- Bugfixes:
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm
index a1258ccaa..ec8df4450 100644
--- a/perllib/FixMyStreet/App/Controller/Around.pm
+++ b/perllib/FixMyStreet/App/Controller/Around.pm
@@ -399,10 +399,13 @@ sub _geocode : Private {
sub lookup_by_ref : Private {
my ( $self, $c, $ref ) = @_;
- my $problems = $c->cobrand->problems->search([
- id => $ref,
- external_id => $ref
- ]);
+ my $criteria = $c->cobrand->call_hook("lookup_by_ref", $ref) ||
+ [
+ id => $ref,
+ external_id => $ref
+ ];
+
+ my $problems = $c->cobrand->problems->search( $criteria );
my $count = try {
$problems->count;