From a503961c5acc60199df7e539d3dc3f537b2adbea Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Thu, 1 Dec 2016 13:06:24 +0000 Subject: Better path for showing config git version. The default cobrand does not have a template directory, so the directory change to it was not working. Use the root directory of the repository instead. --- perllib/FixMyStreet/App/Controller/Admin.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'perllib/FixMyStreet/App/Controller/Admin.pm') diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index e91597bb0..3782063d5 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -129,7 +129,7 @@ sub index : Path : Args(0) { sub config_page : Path( 'config' ) : Args(0) { my ($self, $c) = @_; - my $dir = $c->stash->{additional_template_paths}->[0]; + my $dir = FixMyStreet->path_to(); my $git_version = `cd $dir && git describe --tags`; chomp $git_version; $c->stash( -- cgit v1.2.3 From 102418842a833c29f855557bf4c410290b5a2020 Mon Sep 17 00:00:00 2001 From: Dave Arter Date: Tue, 6 Dec 2016 11:57:34 +0000 Subject: [Zurich] Fix 500 error when editing superusers The Zurich::admin_type function was setting $c->stash->{body}, meaning that when trying to edit a superuser the 'fetch_contacts' function wasn't being called, causing an "Can't call method "all" on an undefined value" error as $c->stash->{live_contacts} wasn't ever being set. Fixed by changing the conditional to simply determine whether fetch_contacts needs to be called. Included a regression test that meant a small addition to the MapItZurich mock. --- perllib/FixMyStreet/App/Controller/Admin.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'perllib/FixMyStreet/App/Controller/Admin.pm') diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index 3782063d5..bbdf449aa 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -1377,7 +1377,7 @@ sub user_edit : Path('user_edit') : Args(1) { } if ( $user->from_body ) { - unless ( $c->stash->{body} && $user->from_body->id eq $c->stash->{body}->id ) { + unless ( $c->stash->{live_contacts} ) { $c->stash->{body} = $user->from_body; $c->forward('fetch_contacts'); } -- cgit v1.2.3