Bug 21626: (QA follow-up) Don't crash on missing teams file
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 14 May 2019 14:34:44 +0000 (15:34 +0100)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 17 May 2019 14:46:10 +0000 (14:46 +0000)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

about.pl
koha-tmpl/intranet-tmpl/prog/en/modules/about.tt

index e95dbc1..dacd39d 100755 (executable)
--- 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);
index eae4a80..60ce4ac 100644 (file)
             </ul>
 
             <h2>Koha release teams</h2>
-            <div class="row">
-                <div class="col-md-6">
-                    <h3>Koha [% short_version | html %] release team</h3>
-                    [% IF development_version %]
-                        <p>You are running a development version of Koha</p>
-                    [% ELSE %]
-                        [% INCLUDE team t=release_team v='release' %]
-                    [% END %]
-                </div>
+            [% IF maintenance_team %]
+                <div class="row">
+                    <div class="col-md-6">
+                        <h3>Koha [% short_version | html %] release team</h3>
+                        [% IF development_version %]
+                            <p>You are running a development version of Koha</p>
+                        [% ELSE %]
+                            [% INCLUDE team t=release_team v='release' %]
+                        [% END %]
+                    </div>
 
-                <div class="col-md-6">
-                    <h3>Current maintenance team</h3>
-                    [% INCLUDE team t=maintenance_team v=short_version %]
+                    <div class="col-md-6">
+                        <h3>Current maintenance team</h3>
+                        [% INCLUDE team t=maintenance_team v=short_version %]
+                    </div>
                 </div>
-            </div>
+            [% ELSE %]
+                <div class="dialog alert">
+                    Could not read the teams.yaml file. Please make sure &lt;docdir&gt; is correctly defined in koha-conf.xml.
+                </div>
+            [% END %]
 
             <h2>Koha development team</h2>
             [% IF contributors.size %]