From d4b503aa14b9297889c2a5b6f18fd2132c7bb304 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Sun, 12 May 2019 19:22:54 -0500 Subject: [PATCH] Bug 22893: Do not crash if contributors.yaml does not exist Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi Signed-off-by: Nick Clemens --- about.pl | 5 ++++- koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 16 +++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/about.pl b/about.pl index 62d15edf16..0a7300ce4d 100755 --- a/about.pl +++ b/about.pl @@ -531,7 +531,10 @@ if ( defined C4::Context->config('docdir') ) { } ## Contributors -my $contributors = LoadFile("$docdir"."/contributors.yaml"); +my $contributors = + -e "$docdir" . "/contributors.yaml" + ? LoadFile( "$docdir" . "/contributors.yaml" ) + : {}; my @people = map { { name => $_, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt index b908428e7b..39216984bc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -469,11 +469,17 @@

Koha development team

-
    - [% FOREACH contributor IN contributors %] -
  • [% INCLUDE person p=contributor %][% INCLUDE contributions p=contributor %]
  • - [% END %] -
+ [% IF contributors.size %] +
    + [% FOREACH contributor IN contributors %] +
  • [% INCLUDE person p=contributor %][% INCLUDE contributions p=contributor %]
  • + [% END %] +
+ [% ELSE %] +
+ Could not read the contributors.yaml file. Please make sure <docdir> is correctly defined in koha-conf.xml. +
+ [% END %]

Contributing companies and institutions

-- 2.39.5