-my $dir = C4::Context->config('intranetdir');
-open( my $file, "<", "$dir" . "/docs/history.txt" );
-my $i = 0;
+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';
+}