Bug 10915: fix About->timeline breakage on incompletely upgraded Koha

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>
(cherry picked from commit 3ae471a352)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit 77daa7d76d)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit 77daa7d76d)
This commit is contained in:
Mason James 2013-09-20 00:06:20 +12:00 committed by Bernardo Gonzalez Kriegel
parent 8b9759e657
commit 7e6e331a3f
1 changed files with 9 additions and 1 deletions

View File

@ -145,7 +145,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;