Bug 10915: fix About->timeline breakage on incompletely upgraded Koha
authorMason James <mtj@kohaaloha.com>
Thu, 19 Sep 2013 12:06:20 +0000 (00:06 +1200)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 20 Sep 2013 17:24:41 +0000 (17:24 +0000)
This patch supplies a default value for the koha-conf.xml
setting docdir to handle the case where the user neglects
to set it upon upgrade.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Fixes dev and standard installs without docdic tag in koha-conf.xml.
Doesn't break when docdir present either. Warning still present
on packages install that didn't add the docdir definition in koha-conf.xml

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

about.pl

index ef45340..0ba7291 100755 (executable)
--- a/about.pl
+++ b/about.pl
@@ -148,7 +148,15 @@ $template->param( table => $table );
 ## Koha time line code
 
 #get file location
-my $docdir = C4::Context->config('docdir');
+my $docdir;
+if ( defined C4::Context->config('docdir') ) {
+    $docdir = C4::Context->config('docdir');
+} else {
+    # if no <docdir> is defined in koha-conf.xml, use the default location
+    # this is a work-around to stop breakage on upgraded Kohas, bug 8911
+    $docdir = C4::Context->config('intranetdir') . '/docs';
+}
+
 open( my $file, "<", "$docdir" . "/history.txt" );
 my $i = 0;