Bugzilla – Attachment 21253 Details for
Bug 10915
about->timeline broken on upgraded Koha
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10915: (Possible) QA followup - warn if cannot read history.txt
Bug-10915-Possible-QA-followup---warn-if-cannot-re.patch (text/plain), 3.24 KB, created by
Tomás Cohen Arazi (tcohen)
on 2013-09-19 15:42:58 UTC
(
hide
)
Description:
Bug 10915: (Possible) QA followup - warn if cannot read history.txt
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2013-09-19 15:42:58 UTC
Size:
3.24 KB
patch
obsolete
>From 8238cd0556df7052ef3e6fb5d20587e138e2633f Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Thu, 19 Sep 2013 12:40:03 -0300 >Subject: [PATCH] Bug 10915: (Possible) QA followup - warn if cannot read > history.txt > >This patch makes about.pl test if success opening history.txt, and >shows a convenient warning to the end user. No more warnings in the logs >(about.pl: readline() on closed filehandle $file at /usr/share/koha/intranet/cgi-bin/about.pl line 166) >and better problem solving information for the end user. > >Regards >To+ > >Sponsored-by: Universidad Nacional de Cordoba >--- > about.pl | 58 ++++++++++++---------- > koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 6 +++ > 2 files changed, 37 insertions(+), 27 deletions(-) > >diff --git a/about.pl b/about.pl >index 0ba7291..6b44ea8 100755 >--- a/about.pl >+++ b/about.pl >@@ -157,39 +157,43 @@ if ( defined C4::Context->config('docdir') ) { > $docdir = C4::Context->config('intranetdir') . '/docs'; > } > >-open( my $file, "<", "$docdir" . "/history.txt" ); >-my $i = 0; >+if ( open( my $file, "<", "$docdir" . "/history.txt" ) ) { > >-my @rows2 = (); >-my $row2 = []; >+ my $i = 0; > >-my @lines = <$file>; >-close($file); >+ my @rows2 = (); >+ my $row2 = []; > >-shift @lines; #remove header row >+ my @lines = <$file>; >+ close($file); > >-foreach (@lines) { >- my ( $date, $desc, $tag ) = split(/\t/); >- if(!$desc && $date=~ /(?<=\d{4})\s+/) { >- ($date, $desc)= ($`, $'); >- } >- push( >- @rows2, >- { >- date => $date, >- desc => $desc, >+ shift @lines; #remove header row >+ >+ foreach (@lines) { >+ my ( $date, $desc, $tag ) = split(/\t/); >+ if(!$desc && $date=~ /(?<=\d{4})\s+/) { >+ ($date, $desc)= ($`, $'); > } >- ); >-} >+ push( >+ @rows2, >+ { >+ date => $date, >+ desc => $desc, >+ } >+ ); >+ } > >-my $table2 = []; >-#foreach my $row2 (@rows2) { >-foreach (@rows2) { >- push (@$row2, $_); >- push( @$table2, { row2 => $row2 } ); >- $row2 = []; >-} >+ my $table2 = []; >+ #foreach my $row2 (@rows2) { >+ foreach (@rows2) { >+ push (@$row2, $_); >+ push( @$table2, { row2 => $row2 } ); >+ $row2 = []; >+ } > >-$template->param( table2 => $table2 ); >+ $template->param( table2 => $table2 ); >+} else { >+ $template->param( timeline_read_error => 1 ); >+} > > output_html_with_http_headers $query, $cookie, $template->output; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >index 5d32bbe..57aa522 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >@@ -530,6 +530,7 @@ > > <div id="history"> > <h2>Koha history timeline</h2> >+ [% IF ! timeline_read_error %] > <table style="cursor:pointer"> > <thead> > <tr> >@@ -546,6 +547,11 @@ > </tr> > [% END %] > </table> >+ [% ELSE %] >+ <div class="dialog alert"> >+ Could not read the history.txt file. Please make sure <docdir> is correctly defined in koha-conf.xml. >+ </div> >+ [% END %] > </div> > > </div> >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10915
:
21237
|
21238
|
21239
|
21251
| 21253