diff options
author | Edmund von der Burg <evdb@mysociety.org> | 2011-04-15 10:25:46 +0100 |
---|---|---|
committer | Edmund von der Burg <evdb@mysociety.org> | 2011-04-15 10:25:46 +0100 |
commit | 7a366593576587a6b654ea967e8beefb2dba6b1c (patch) | |
tree | 74a0c02116ab5f3f8383578f522481481573bb29 /perllib/FixMyStreet/Cobrand/Default.pm | |
parent | 82f853c5abb9788d4c0f16b4dcb1c91dd9eb8337 (diff) |
Proper FakeQ object to interface with old code
Diffstat (limited to 'perllib/FixMyStreet/Cobrand/Default.pm')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index 14f8f6ba3..097ce3ef7 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -56,7 +56,8 @@ sub is_default { =head2 fake_q - $fake_q = $cobrand->fake_q; + $fake_q = $cobrand->fake_q; + $new_fake_q = $cobrand->fake_q($new_fake_q); Often the cobrand needs access to the request so we add it at the start by passing it to ->new. If the request has not been set and you call this (or a @@ -67,6 +68,8 @@ use a request-related method out of a request-context. sub fake_q { my $self = shift; + $self->{fake_q} = shift if @_; + return $self->{fake_q} || croak "No fake_q has been set" . " - should you be calling this method outside of a web request?"; |