aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2015-11-20 21:37:17 +0000
committerMatthew Somerville <matthew@mysociety.org>2015-12-02 17:41:42 +0000
commit23949e52f20020fa56cd54655a487ef97ebbc222 (patch)
treefd8a58a3b6df905851ecbed5d83919d7d9d88ed1
parentd48de55d99bd55b28c5aa0fd9f095e9c918b52cb (diff)
Remove many uses of mySociety::Config.
-rwxr-xr-xbin/handlemail23
-rwxr-xr-xbin/handlemail-support20
-rwxr-xr-xbin/send-alerts4
-rwxr-xr-xbin/send-comments4
-rwxr-xr-xbin/send-questionnaires4
-rwxr-xr-xbin/send-reports4
-rwxr-xr-xbin/update-schema13
-rw-r--r--perllib/FixMyStreet.pm20
-rwxr-xr-xperllib/FixMyStreet/App/Controller/Rss.pm2
-rw-r--r--perllib/FixMyStreet/Cobrand/UKCouncils.pm2
-rw-r--r--perllib/FixMyStreet/DB/Result/Problem.pm2
-rw-r--r--perllib/FixMyStreet/DB/ResultSet/Problem.pm12
-rw-r--r--perllib/FixMyStreet/Geocode/Bing.pm2
-rw-r--r--perllib/FixMyStreet/SendReport/EastHants.pm2
-rw-r--r--perllib/FixMyStreet/SendReport/Email.pm6
-rw-r--r--perllib/FixMyStreet/SendReport/EmptyHomes.pm6
-rw-r--r--perllib/FixMyStreet/SendReport/Open311.pm1
-rw-r--r--perllib/Open311/PopulateServiceList.pm2
-rw-r--r--t/00-check-we-are-staging.t17
-rw-r--r--t/app/controller/rss.t2
-rw-r--r--t/app/model/alert_type.t6
21 files changed, 64 insertions, 90 deletions
diff --git a/bin/handlemail b/bin/handlemail
index 5d4ac753c..597d08a5d 100755
--- a/bin/handlemail
+++ b/bin/handlemail
@@ -17,15 +17,14 @@ use strict;
use warnings;
require 5.8.0;
-# Horrible boilerplate to set up appropriate library paths.
-use FindBin;
-use lib "$FindBin::Bin/../perllib";
-use lib "$FindBin::Bin/../commonlib/perllib";
-
-use mySociety::Config;
BEGIN {
- mySociety::Config::set_file("$FindBin::Bin/../conf/general");
+ use File::Basename qw(dirname);
+ use File::Spec;
+ my $d = dirname(File::Spec->rel2abs($0));
+ require "$d/../setenv.pl";
}
+
+use FixMyStreet;
use mySociety::Email;
use mySociety::EmailUtil;
use mySociety::HandleMail;
@@ -40,7 +39,7 @@ my %data = mySociety::HandleMail::get_message();
if ($data{is_bounce_message}) {
#my $a = mySociety::HandleMail::get_bounce_recipient($data{message});
#my $token = mySociety::HandleMail::get_token($a,
- # 'fms-', mySociety::Config::get('EMAILDOMAIN')
+ # 'fms-', FixMyStreet->config('EMAILDOMAIN')
#);
#exit(0) if $token eq 'DO-NOT-REPLY'; # A bounce we don't care about
exit(0); # drop all other bounces currently
@@ -48,13 +47,13 @@ if ($data{is_bounce_message}) {
# Not a bounce, send an automatic response
my $template = 'reply-autoresponse';
-open FP, "$FindBin::Bin/../templates/email/default/$template" or exit 75;
-$template = join('', <FP>);
-close FP;
+my $fp = FixMyStreet->path_to("templates", "email", "default", $template)->open or exit 75;
+$template = join('', <$fp>);
+$fp->close;
# We generate this as a bounce.
my $mail = mySociety::Email::construct_email({
- From => [ mySociety::Config::get('CONTACT_EMAIL'), 'FixMyStreet' ],
+ From => [ FixMyStreet->config('CONTACT_EMAIL'), 'FixMyStreet' ],
To => $data{return_path},
_template_ => $template,
_parameters_ => { },
diff --git a/bin/handlemail-support b/bin/handlemail-support
index 9808e447a..0ccde8ca7 100755
--- a/bin/handlemail-support
+++ b/bin/handlemail-support
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
#
# handlemail-support:
# Handle an individual incoming mail message.
@@ -11,17 +11,17 @@
# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
use strict;
+use warnings;
require 5.8.0;
-# Horrible boilerplate to set up appropriate library paths.
-use FindBin;
-use lib "$FindBin::Bin/../perllib";
-use lib "$FindBin::Bin/../commonlib/perllib";
-
-use mySociety::Config;
BEGIN {
- mySociety::Config::set_file("$FindBin::Bin/../conf/general");
+ use File::Basename qw(dirname);
+ use File::Spec;
+ my $d = dirname(File::Spec->rel2abs($0));
+ require "$d/../setenv.pl";
}
+
+use FixMyStreet;
use mySociety::EmailUtil;
use mySociety::HandleMail;
@@ -32,7 +32,7 @@ forward_on();
# ---
sub forward_on {
- my ($l, $d) = split /\@/, mySociety::Config::get('CONTACT_EMAIL');
+ my ($l, $d) = split /\@/, FixMyStreet->config('CONTACT_EMAIL');
if (mySociety::EmailUtil::EMAIL_SUCCESS
!= mySociety::EmailUtil::send_email(
join("\n", @{$data{lines}}) . "\n",
@@ -50,7 +50,7 @@ sub is_ignorable {
my ($from, $subject, $body) = ($head->get('From'), $head->get('Subject'), $m->body);
$body = join("\n", @$body);
- open my $fp, "$FindBin::Bin/../../data/ignored-emails.csv" or exit 75;
+ my $fp = FixMyStreet->path_to("..", "data", "ignored-emails.csv")->open or exit 75;
while (<$fp>) {
chomp;
my ($f, $s, $b) = split /,/;
diff --git a/bin/send-alerts b/bin/send-alerts
index b0040268a..eaebe9b66 100755
--- a/bin/send-alerts
+++ b/bin/send-alerts
@@ -20,10 +20,10 @@ BEGIN {
use CGI; # XXX
use CronFns;
-use mySociety::Config;
+use FixMyStreet;
use FixMyStreet::DB;
-my $site = CronFns::site(mySociety::Config::get('BASE_URL'));
+my $site = CronFns::site(FixMyStreet->config('BASE_URL'));
CronFns::language($site);
FixMyStreet::DB->resultset('AlertType')->email_alerts();
diff --git a/bin/send-comments b/bin/send-comments
index c3f21fb2c..bf5f27ce0 100755
--- a/bin/send-comments
+++ b/bin/send-comments
@@ -22,8 +22,8 @@ BEGIN {
use CronFns;
-use mySociety::Config;
use DateTime;
+use FixMyStreet;
use FixMyStreet::Cobrand;
use FixMyStreet::DB;
use Open311;
@@ -36,7 +36,7 @@ use constant COUNCIL_ID_OXFORDSHIRE => 2237;
# Set up site, language etc.
my ($verbose, $nomail) = CronFns::options();
-my $base_url = mySociety::Config::get('BASE_URL');
+my $base_url = FixMyStreet->config('BASE_URL');
my $site = CronFns::site($base_url);
my $bodies = FixMyStreet::DB->resultset('Body')->search( {
diff --git a/bin/send-questionnaires b/bin/send-questionnaires
index 141c21560..15b8027f3 100755
--- a/bin/send-questionnaires
+++ b/bin/send-questionnaires
@@ -19,12 +19,12 @@ BEGIN {
use CGI; # XXX Awkward kludge
use CronFns;
+use FixMyStreet;
use FixMyStreet::DB;
-use mySociety::Config;
my %params;
( $params{verbose}, $params{nomail} ) = CronFns::options();
-$params{site} = CronFns::site(mySociety::Config::get('BASE_URL'));
+$params{site} = CronFns::site(FixMyStreet->config('BASE_URL'));
CronFns::language($params{site});
FixMyStreet::DB->resultset('Questionnaire')->send_questionnaires( \%params );
diff --git a/bin/send-reports b/bin/send-reports
index 5765edbfa..2dfe415fa 100755
--- a/bin/send-reports
+++ b/bin/send-reports
@@ -20,10 +20,10 @@ BEGIN {
use CGI; # XXX
use CronFns;
-use mySociety::Config;
+use FixMyStreet;
use FixMyStreet::DB;
-my $site = CronFns::site(mySociety::Config::get('BASE_URL'));
+my $site = CronFns::site(FixMyStreet->config('BASE_URL'));
CronFns::language($site);
FixMyStreet::DB->resultset('Problem')->send_reports();
diff --git a/bin/update-schema b/bin/update-schema
index 1af08b002..c6b197deb 100755
--- a/bin/update-schema
+++ b/bin/update-schema
@@ -39,20 +39,19 @@ BEGIN {
require "$bin_dir/../setenv.pl";
}
-use mySociety::Config;
+use FixMyStreet;
use mySociety::DBHandle qw(dbh);
use mySociety::MaPit;
use Getopt::Long;
use Pod::Usage;
-mySociety::Config::set_file("$bin_dir/../conf/general");
my %args = (
- Name => mySociety::Config::get('FMS_DB_NAME'),
- User => mySociety::Config::get('FMS_DB_USER'),
- Password => mySociety::Config::get('FMS_DB_PASS'),
+ Name => FixMyStreet->config('FMS_DB_NAME'),
+ User => FixMyStreet->config('FMS_DB_USER'),
+ Password => FixMyStreet->config('FMS_DB_PASS'),
);
-$args{Host} = mySociety::Config::get('FMS_DB_HOST', undef) if mySociety::Config::get('FMS_DB_HOST');
-$args{Port} = mySociety::Config::get('FMS_DB_PORT', undef) if mySociety::Config::get('FMS_DB_PORT');
+$args{Host} = FixMyStreet->config('FMS_DB_HOST', undef) if FixMyStreet->config('FMS_DB_HOST');
+$args{Port} = FixMyStreet->config('FMS_DB_PORT', undef) if FixMyStreet->config('FMS_DB_PORT');
mySociety::DBHandle::configure( %args );
my ($commit, $version, $downgrade, $help);
diff --git a/perllib/FixMyStreet.pm b/perllib/FixMyStreet.pm
index 3fc067d3e..1a9c8ff60 100644
--- a/perllib/FixMyStreet.pm
+++ b/perllib/FixMyStreet.pm
@@ -95,15 +95,12 @@ sub override_config($&) {
mySociety::MaPit::configure($config->{MAPIT_URL}) if $config->{MAPIT_URL};
- # For historical reasons, we have two ways of asking for config variables.
- # Override them both, I'm sure we'll find time to get rid of one eventually.
- #
- # NB: though we have these two functions, templates tend to use [% c.config %]
+ # NB: though we have this, templates tend to use [% c.config %].
# This overriding happens after $c->config is set, so note that
# FixMyStreet::App->setup_request rewrites $c->config if we are in
# test_mode, so tests should Just Work there too.
- my $override_guard1 = Sub::Override->new(
+ my $override_guard = Sub::Override->new(
"FixMyStreet::config",
sub {
my ($class, $key) = @_;
@@ -113,23 +110,12 @@ sub override_config($&) {
return $orig_config->{$key} if exists $orig_config->{$key};
}
);
- my $override_guard2 = Sub::Override->new(
- "mySociety::Config::get",
- sub ($;$) {
- my ($key, $default) = @_;
- return $config->{$key} if exists $config->{$key};
- my $orig_config = mySociety::Config::load_default();
- return $orig_config->{$key} if exists $orig_config->{$key};
- return $default if @_ == 2;
- }
- );
FixMyStreet::Map::reload_allowed_maps() if $config->{MAP_TYPE};
$code->();
- $override_guard1->restore();
- $override_guard2->restore();
+ $override_guard->restore();
mySociety::MaPit::configure() if $config->{MAPIT_URL};
FixMyStreet::Map::reload_allowed_maps() if $config->{MAP_TYPE};
}
diff --git a/perllib/FixMyStreet/App/Controller/Rss.pm b/perllib/FixMyStreet/App/Controller/Rss.pm
index b817fe326..586d5e7ae 100755
--- a/perllib/FixMyStreet/App/Controller/Rss.pm
+++ b/perllib/FixMyStreet/App/Controller/Rss.pm
@@ -218,7 +218,7 @@ sub query_main : Private {
. ($alert_type->head_table ? $alert_type->head_table . '_id=? and ' : '')
. $alert_type->item_where . ' order by '
. $alert_type->item_order;
- my $rss_limit = mySociety::Config::get('RSS_LIMIT');
+ my $rss_limit = FixMyStreet->config('RSS_LIMIT');
$query .= " limit $rss_limit" unless $c->stash->{type} =~ /^all/;
my $q = $c->model('DB::Alert')->result_source->storage->dbh->prepare($query);
diff --git a/perllib/FixMyStreet/Cobrand/UKCouncils.pm b/perllib/FixMyStreet/Cobrand/UKCouncils.pm
index 66d8bd472..0fb8c23d0 100644
--- a/perllib/FixMyStreet/Cobrand/UKCouncils.pm
+++ b/perllib/FixMyStreet/Cobrand/UKCouncils.pm
@@ -43,7 +43,7 @@ sub problems {
sub base_url {
my $self = shift;
- my $base_url = mySociety::Config::get('BASE_URL');
+ my $base_url = FixMyStreet->config('BASE_URL');
my $u = $self->council_url;
if ( $base_url !~ /$u/ ) {
# council cobrands are not https so transform to http as well
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm
index 5c4511268..2eb6c6fc7 100644
--- a/perllib/FixMyStreet/DB/Result/Problem.pm
+++ b/perllib/FixMyStreet/DB/Result/Problem.pm
@@ -628,7 +628,7 @@ sub body {
$body = join( _(' and '),
map {
my $name = $_->name;
- if ($c and mySociety::Config::get('AREA_LINKS_FROM_PROBLEMS')) {
+ if ($c and FixMyStreet->config('AREA_LINKS_FROM_PROBLEMS')) {
'<a href="' . $_->url($c) . '">' . $name . '</a>';
} else {
$name;
diff --git a/perllib/FixMyStreet/DB/ResultSet/Problem.pm b/perllib/FixMyStreet/DB/ResultSet/Problem.pm
index 8e6cc7333..0d7b34daf 100644
--- a/perllib/FixMyStreet/DB/ResultSet/Problem.pm
+++ b/perllib/FixMyStreet/DB/ResultSet/Problem.pm
@@ -7,9 +7,9 @@ use warnings;
use CronFns;
use Utils;
-use mySociety::Config;
use mySociety::MaPit;
+use FixMyStreet;
use FixMyStreet::Cobrand;
use FixMyStreet::Email;
use FixMyStreet::SendReport;
@@ -247,7 +247,7 @@ sub send_reports {
# Set up site, language etc.
my ($verbose, $nomail, $debug_mode) = CronFns::options();
- my $base_url = mySociety::Config::get('BASE_URL');
+ my $base_url = FixMyStreet->config('BASE_URL');
my $site = $site_override || CronFns::site($base_url);
my $states = [ 'confirmed', 'fixed' ];
@@ -424,7 +424,7 @@ sub send_reports {
. " ]\n\n";
}
- if (mySociety::Config::get('STAGING_SITE') && !mySociety::Config::get('SEND_REPORTS_ON_STAGING')) {
+ if (FixMyStreet->config('STAGING_SITE') && !FixMyStreet->config('SEND_REPORTS_ON_STAGING')) {
# on a staging server send emails to ourselves rather than the bodies
%reporters = map { $_ => $reporters{$_} } grep { /FixMyStreet::SendReport::(Email|EmptyHomes)/ } keys %reporters;
unless (%reporters) {
@@ -495,7 +495,7 @@ sub send_reports {
send_fail_count => { '>', 0 }
} );
while (my $row = $unsent->next) {
- my $base_url = mySociety::Config::get('BASE_URL');
+ my $base_url = FixMyStreet->config('BASE_URL');
$sending_errors .= "* " . $base_url . "/report/" . $row->id . ", failed "
. $row->send_fail_count . " times, last at " . $row->send_fail_timestamp
. ", reason " . $row->send_fail_reason . "\n";
@@ -520,9 +520,9 @@ sub _send_report_sent_email {
_template_ => $template,
_parameters_ => $h,
To => $row->user->email,
- From => [ mySociety::Config::get('CONTACT_EMAIL'), $cobrand->contact_name ],
+ From => [ FixMyStreet->config('CONTACT_EMAIL'), $cobrand->contact_name ],
},
- mySociety::Config::get('CONTACT_EMAIL'),
+ FixMyStreet->config('CONTACT_EMAIL'),
$nomail,
$cobrand
);
diff --git a/perllib/FixMyStreet/Geocode/Bing.pm b/perllib/FixMyStreet/Geocode/Bing.pm
index d7db10ae6..8cad8be7c 100644
--- a/perllib/FixMyStreet/Geocode/Bing.pm
+++ b/perllib/FixMyStreet/Geocode/Bing.pm
@@ -71,7 +71,7 @@ sub reverse {
my ( $latitude, $longitude, $bing_culture ) = @_;
# Get nearest road-type thing from Bing
- my $key = mySociety::Config::get('BING_MAPS_API_KEY', '');
+ my $key = FixMyStreet->config('BING_MAPS_API_KEY', '');
if ($key) {
my $url = "http://dev.virtualearth.net/REST/v1/Locations/$latitude,$longitude?key=$key";
$url .= '&c=' . $bing_culture if $bing_culture;
diff --git a/perllib/FixMyStreet/SendReport/EastHants.pm b/perllib/FixMyStreet/SendReport/EastHants.pm
index 697519b48..3eb8ffcfa 100644
--- a/perllib/FixMyStreet/SendReport/EastHants.pm
+++ b/perllib/FixMyStreet/SendReport/EastHants.pm
@@ -28,7 +28,7 @@ EOF
}
sub send {
- return if mySociety::Config::get('STAGING_SITE');
+ return if FixMyStreet->config('STAGING_SITE');
my ( $self, $row, $h ) = @_;
diff --git a/perllib/FixMyStreet/SendReport/Email.pm b/perllib/FixMyStreet/SendReport/Email.pm
index 3e993ecd6..4d2c8bb17 100644
--- a/perllib/FixMyStreet/SendReport/Email.pm
+++ b/perllib/FixMyStreet/SendReport/Email.pm
@@ -75,7 +75,7 @@ sub send {
my $recips = $self->build_recipient_list( $row, $h );
# on a staging server send emails to ourselves rather than the bodies
- if (mySociety::Config::get('STAGING_SITE') && !mySociety::Config::get('SEND_REPORTS_ON_STAGING') && !FixMyStreet->test_mode) {
+ if (FixMyStreet->config('STAGING_SITE') && !FixMyStreet->config('SEND_REPORTS_ON_STAGING') && !FixMyStreet->test_mode) {
$recips = 1;
@{$self->to} = [ $row->user->email, $self->to->[0][1] || $row->name ];
}
@@ -100,13 +100,13 @@ sub send {
if (FixMyStreet::Email::test_dmarc($params->{From}[0])) {
$params->{'Reply-To'} = [ $params->{From} ];
- $params->{From} = [ mySociety::Config::get('CONTACT_EMAIL'), $params->{From}[1] ];
+ $params->{From} = [ FixMyStreet->config('CONTACT_EMAIL'), $params->{From}[1] ];
}
my $result = FixMyStreet::Email::send_cron(
$row->result_source->schema,
$params,
- mySociety::Config::get('CONTACT_EMAIL'),
+ FixMyStreet->config('CONTACT_EMAIL'),
$nomail,
$cobrand
);
diff --git a/perllib/FixMyStreet/SendReport/EmptyHomes.pm b/perllib/FixMyStreet/SendReport/EmptyHomes.pm
index a4cdd3e40..b5faf8ddc 100644
--- a/perllib/FixMyStreet/SendReport/EmptyHomes.pm
+++ b/perllib/FixMyStreet/SendReport/EmptyHomes.pm
@@ -34,11 +34,11 @@ sub build_recipient_list {
my $area_info = mySociety::MaPit::call('area', $body->body_areas->first->area_id);
my $country = $area_info->{country};
if ($country eq 'W') {
- push @{$self->bcc}, 'wales@' . mySociety::Config::get('EMAIL_DOMAIN');
+ push @{$self->bcc}, 'wales@' . FixMyStreet->config('EMAIL_DOMAIN');
} elsif ($country eq 'S') {
- push @{$self->bcc}, 'scotland@' . mySociety::Config::get('EMAIL_DOMAIN');
+ push @{$self->bcc}, 'scotland@' . FixMyStreet->config('EMAIL_DOMAIN');
} else {
- push @{$self->bcc}, 'eha@' . mySociety::Config::get('EMAIL_DOMAIN');
+ push @{$self->bcc}, 'eha@' . FixMyStreet->config('EMAIL_DOMAIN');
}
}
diff --git a/perllib/FixMyStreet/SendReport/Open311.pm b/perllib/FixMyStreet/SendReport/Open311.pm
index 1917c2f58..4844aa2e9 100644
--- a/perllib/FixMyStreet/SendReport/Open311.pm
+++ b/perllib/FixMyStreet/SendReport/Open311.pm
@@ -5,7 +5,6 @@ use namespace::autoclean;
BEGIN { extends 'FixMyStreet::SendReport'; }
-use mySociety::Config;
use DateTime::Format::W3CDTF;
use Open311;
use Readonly;
diff --git a/perllib/Open311/PopulateServiceList.pm b/perllib/Open311/PopulateServiceList.pm
index f251606cf..15a827217 100644
--- a/perllib/Open311/PopulateServiceList.pm
+++ b/perllib/Open311/PopulateServiceList.pm
@@ -39,7 +39,7 @@ sub process_body {
unless ( $list && $list->{service} ) {
if ($self->verbose >= 1) {
my $id = $self->_current_body->id;
- my $mapit_url = mySociety::Config::get('MAPIT_URL');
+ my $mapit_url = FixMyStreet->config('MAPIT_URL');
my $areas = join( ",", keys %{$self->_current_body->areas} );
warn "Body $id for areas $areas - $mapit_url/areas/$areas.html - did not return a service list\n";
warn $open311->error;
diff --git a/t/00-check-we-are-staging.t b/t/00-check-we-are-staging.t
index 4c9a255fe..072b5df76 100644
--- a/t/00-check-we-are-staging.t
+++ b/t/00-check-we-are-staging.t
@@ -5,21 +5,12 @@ use Test::More;
use FixMyStreet;
-# check that all the fields listed in general-example are also present in
-# general - helps prevent later test failures due to un-noticed additions to the
-# config file.
-
-# This code will bail_out to prevent the test suite proceeding to save time if
-# issues are found.
-
-# load the config file and store the contents in a readonly hash
-
-my $CONF_FILE = $ENV{FMS_OVERRIDE_CONFIG} || 'general';
-mySociety::Config::set_file( FixMyStreet->path_to("conf/${CONF_FILE}") );
+# check that we are running on staging
BAIL_OUT( "Test suite modifies databases so should not be run on live servers" )
- unless mySociety::Config::get('STAGING_SITE', undef);
+ unless FixMyStreet->config('STAGING_SITE');
-ok mySociety::Config::get('STAGING_SITE', undef), 'staging server';
+my $staging = FixMyStreet->config('STAGING_SITE');
+ok $staging, 'staging server';
done_testing();
diff --git a/t/app/controller/rss.t b/t/app/controller/rss.t
index db653c094..3e820cff3 100644
--- a/t/app/controller/rss.t
+++ b/t/app/controller/rss.t
@@ -181,7 +181,7 @@ my $report_to_county_council = FixMyStreet::App->model('DB::Problem')->find_or_c
subtest "check RSS feeds on cobrand have correct URLs for non-cobrand reports" => sub {
$mech->host('hart.fixmystreet.com');
- my $expected1 = mySociety::Config::get('BASE_URL') . '/report/' . $report_to_county_council->id;
+ my $expected1 = FixMyStreet->config('BASE_URL') . '/report/' . $report_to_county_council->id;
my $expected2;
FixMyStreet::override_config {
diff --git a/t/app/model/alert_type.t b/t/app/model/alert_type.t
index f67b5d1f7..0130f404e 100644
--- a/t/app/model/alert_type.t
+++ b/t/app/model/alert_type.t
@@ -442,8 +442,8 @@ subtest "check alerts from cobrand send main site url for alerts for different c
my $email = $mech->get_email;
my $body = $email->body;
- my $expected1 = mySociety::Config::get('BASE_URL') . '/report/' . $report_to_county_council->id;
- my $expected3 = mySociety::Config::get('BASE_URL') . '/report/' . $report_outside_district->id;
+ my $expected1 = FixMyStreet->config('BASE_URL') . '/report/' . $report_to_county_council->id;
+ my $expected3 = FixMyStreet->config('BASE_URL') . '/report/' . $report_outside_district->id;
my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker('hart')->new();
my $expected2 = $cobrand->base_url . '/report/' . $report_to_council->id;
@@ -479,7 +479,7 @@ subtest "check local alerts from cobrand send main site url for alerts for diffe
my $email = $mech->get_email;
my $body = $email->body;
- my $expected1 = mySociety::Config::get('BASE_URL') . '/report/' . $report_to_county_council->id;
+ my $expected1 = FixMyStreet->config('BASE_URL') . '/report/' . $report_to_county_council->id;
my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker('hart')->new();
my $expected2 = $cobrand->base_url . '/report/' . $report_to_council->id;