From ec08e5af1202eb01cb70b0f922767f02eaeaedc3 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 Signed-off-by: Nick Clemens --- 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 e95dbc146e..dacd39db2d 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 eae4a805d1..60ce4ac21d 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

[% IF contributors.size %] -- 2.39.5