From 508bed3a11ba6bca5ced633de4770c5baae06441 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 14 May 2019 15:34:44 +0100 Subject: [PATCH] Bug 21626: (QA follow-up) Don't crash on missing teams file Signed-off-by: Martin Renvoize --- about.pl | 5 ++- .../intranet-tmpl/prog/en/modules/about.tt | 32 +++++++++++-------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/about.pl b/about.pl index 970761eba4..76af3fbac3 100755 --- a/about.pl +++ b/about.pl @@ -531,7 +531,10 @@ if ( defined C4::Context->config('docdir') ) { } ## Release teams -my $teams = LoadFile("$docdir"."/teams.yaml"); +my $teams = + -e "$docdir" . "/teams.yaml" + ? LoadFile( "$docdir" . "/teams.yaml" ) + : {}; my $dev_team = (sort {$b <=> $a} (keys %{$teams->{team}}))[0]; my $short_version = substr($versions{'kohaVersion'},0,5); my $minor = substr($versions{'kohaVersion'},3,2); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt index ff235b589c..2610a157a0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -405,21 +405,27 @@

Koha release teams

-
-
-

Koha [% short_version | html %] release team

- [% IF development_version %] -

You are running a development version of Koha

- [% ELSE %] - [% INCLUDE team t=release_team v='release' %] - [% END %] -
+ [% IF maintenance_team %] +
+
+

Koha [% short_version | html %] release team

+ [% IF development_version %] +

You are running a development version of Koha

+ [% ELSE %] + [% INCLUDE team t=release_team v='release' %] + [% END %] +
-
-

Current maintenance team

- [% INCLUDE team t=maintenance_team v=short_version %] +
+

Current maintenance team

+ [% INCLUDE team t=maintenance_team v=short_version %] +
+
+ [% ELSE %] +
+ Could not read the teams.yaml file. Please make sure <docdir> is correctly defined in koha-conf.xml.
-
+ [% END %]

Koha development team

    -- 2.20.1