diff options
author | Struan Donald <struan@exo.org.uk> | 2018-10-03 14:42:55 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2018-10-09 11:10:37 +0100 |
commit | 66da7757654bef6bbbc92704552571bfe0d390ca (patch) | |
tree | 33786f7bbf0597e576b65b756cb2d22ae7d47295 | |
parent | 8cdfbc7660fa5b30e3ea41f105f04b45634f024d (diff) |
allow cobrands to override searching by ref
Add a cobrand hook to allow searching by reference to be overridden
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Around.pm | 11 |
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; |