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 /perllib/FixMyStreet/App/Controller/Around.pm | |
parent | 8cdfbc7660fa5b30e3ea41f105f04b45634f024d (diff) |
allow cobrands to override searching by ref
Add a cobrand hook to allow searching by reference to be overridden
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Around.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Around.pm | 11 |
1 files changed, 7 insertions, 4 deletions
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; |