aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/DB/Result/User.pm5
-rw-r--r--templates/web/fixmystreet.com/header_extra.html2
2 files changed, 5 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/DB/Result/User.pm b/perllib/FixMyStreet/DB/Result/User.pm
index 6bce415a6..054be3644 100644
--- a/perllib/FixMyStreet/DB/Result/User.pm
+++ b/perllib/FixMyStreet/DB/Result/User.pm
@@ -201,10 +201,11 @@ sub belongs_to_body {
my $self = shift;
my $bodies = shift;
- my %bodies = map { $_ => 1 } split ',', $bodies;
+ return 0 unless $bodies && $self->from_body;
- return 1 if $self->from_body && $bodies{ $self->from_body->id };
+ my %bodies = map { $_ => 1 } split ',', $bodies;
+ return 1 if $bodies{ $self->from_body->id };
return 0;
}
diff --git a/templates/web/fixmystreet.com/header_extra.html b/templates/web/fixmystreet.com/header_extra.html
index e05bc31d2..0d53550eb 100644
--- a/templates/web/fixmystreet.com/header_extra.html
+++ b/templates/web/fixmystreet.com/header_extra.html
@@ -4,6 +4,7 @@
<script src="[% start %][% version('/cobrands/fixmystreet.com/js.js') %]"></script>
[%# We are conducting an A/B experiment %]
+[% IF c.config.BASE_URL == "https://www.fixmystreet.com" %]
<script src="//www.google-analytics.com/cx/api.js?experiment=ZwMlZkAhSbK_tP_QG64QrQ"></script>
<script>
var variation = cxApi.chooseVariation(),
@@ -13,6 +14,7 @@ if (!/about\/council/.test(location.pathname)) {
docElement.className = className + ' variant' + variation;
}
</script>
+[% END %]
<style>
html .variant1 { display: none !important; }
html.variant1 .variant0 { display: none !important; }