Bugzilla – Attachment 3273 Details for
Bug 5791
Robust handling of deleted biblios/authorities
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
(2/2) Error handling for ISBDdetail, MARCdetail and labeledMARCdetail
0003-Bug-5791-2-2-Error-handling-for-ISBDdetail-MARCdetai.patch (text/plain), 9.81 KB, created by
Tomás Cohen Arazi (tcohen)
on 2011-03-09 13:22:28 UTC
(
hide
)
Description:
(2/2) Error handling for ISBDdetail, MARCdetail and labeledMARCdetail
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2011-03-09 13:22:28 UTC
Size:
9.81 KB
patch
obsolete
>From c9241f2f4d52172c052a77dce9963696c28fed8d Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Wed, 9 Mar 2011 10:12:49 -0300 >Subject: [PATCH 3/3] [Bug 5791] (2/2) Error handling for ISBDdetail, MARCdetail and labeledMARCdetail >Content-Type: text/plain; charset="utf-8" > >This follow-up completes what Owen requested on bugzilla for the bug to be closed. If anything remains let me know. > >To+ >--- > C4/Biblio.pm | 1 + > catalogue/ISBDdetail.pl | 9 +++++++++ > catalogue/MARCdetail.pl | 18 ++++++++++++++---- > catalogue/labeledMARCdetail.pl | 15 ++++++++++++--- > .../prog/en/modules/catalogue/ISBDdetail.tmpl | 11 +++++++---- > .../prog/en/modules/catalogue/MARCdetail.tmpl | 9 ++++++--- > .../en/modules/catalogue/labeledMARCdetail.tmpl | 10 ++++++++-- > 7 files changed, 57 insertions(+), 16 deletions(-) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index 8ea5da5..67e587b 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -751,6 +751,7 @@ Return the ISBD view which can be included in opac and intranet > sub GetISBDView { > my ( $biblionumber, $template ) = @_; > my $record = GetMarcBiblio($biblionumber); >+ return undef unless defined $record; > my $itemtype = &GetFrameworkCode($biblionumber); > my ( $holdingbrtagf, $holdingbrtagsubf ) = &GetMarcFromKohaField( "items.holdingbranch", $itemtype ); > my $tagslib = &GetMarcStructure( 1, $itemtype ); >diff --git a/catalogue/ISBDdetail.pl b/catalogue/ISBDdetail.pl >index 7ebe8e0..6dfccfd 100755 >--- a/catalogue/ISBDdetail.pl >+++ b/catalogue/ISBDdetail.pl >@@ -70,6 +70,15 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > # my @fields = $record->fields(); > my $res = GetISBDView($biblionumber, "intranet"); > >+if ( not defined $res ) { >+ # biblionumber invalid -> report and exit >+ $template->param( unknownbiblionumber => 1, >+ biblionumber => $biblionumber >+ ); >+ output_html_with_http_headers $query, $cookie, $template->output; >+ exit; >+} >+ > # count of item linked with biblio > my $itemcount = GetItemsCount($biblionumber); > $template->param( count => $itemcount); >diff --git a/catalogue/MARCdetail.pl b/catalogue/MARCdetail.pl >index d73c5d9..431ba43 100755 >--- a/catalogue/MARCdetail.pl >+++ b/catalogue/MARCdetail.pl >@@ -68,10 +68,6 @@ my $popup = > ; # if set to 1, then don't insert links, it's just to show the biblio > my $subscriptionid = $query->param('subscriptionid'); > >-my $tagslib = &GetMarcStructure(1,$frameworkcode); >- >-my $record = GetMarcBiblio($biblionumber); >-my $biblio = GetBiblioData($biblionumber); > # open template > my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > { >@@ -84,6 +80,20 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > } > ); > >+my $record = GetMarcBiblio($biblionumber); >+ >+if ( not defined $record ) { >+ # biblionumber invalid -> report and exit >+ $template->param( unknownbiblionumber => 1, >+ biblionumber => $biblionumber >+ ); >+ output_html_with_http_headers $query, $cookie, $template->output; >+ exit; >+} >+ >+my $tagslib = &GetMarcStructure(1,$frameworkcode); >+my $biblio = GetBiblioData($biblionumber); >+ > #count of item linked > my $itemcount = GetItemsCount($biblionumber); > $template->param( count => $itemcount, >diff --git a/catalogue/labeledMARCdetail.pl b/catalogue/labeledMARCdetail.pl >index e72a6d1..9560ef3 100755 >--- a/catalogue/labeledMARCdetail.pl >+++ b/catalogue/labeledMARCdetail.pl >@@ -37,9 +37,6 @@ my $popup = > $query->param('popup') > ; # if set to 1, then don't insert links, it's just to show the biblio > >-my $tagslib = GetMarcStructure(1,$frameworkcode); >-my $record = GetMarcBiblio($biblionumber); >-my $biblio = GetBiblioData($biblionumber); > # open template > my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > { >@@ -52,6 +49,18 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > } > ); > >+my $record = GetMarcBiblio($biblionumber); >+if ( not defined $record ) { >+ # biblionumber invalid -> report and exit >+ $template->param( unknownbiblionumber => 1, >+ biblionumber => $biblionumber >+ ); >+ output_html_with_http_headers $query, $cookie, $template->output; >+ exit; >+} >+my $tagslib = GetMarcStructure(1,$frameworkcode); >+my $biblio = GetBiblioData($biblionumber); >+ > #count of item linked > my $itemcount = GetItemsCount($biblionumber); > $template->param( count => $itemcount, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tmpl >index 1516268..f292085 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tmpl >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tmpl >@@ -1,5 +1,5 @@ > <!-- TMPL_INCLUDE NAME="doc-head-open.inc" --> >-<title>Koha › Catalog › ISBD Details for <!-- TMPL_VAR NAME="title" --></title> >+<title>Koha › Catalog › <!-- TMPL_IF NAME="unknownbiblionumber" -->Unknown record<!-- TMPL_ELSE -->ISBD Details for <!-- TMPL_VAR NAME="title" --><!-- /TMPL_IF --></title> > <!-- TMPL_INCLUDE NAME="doc-head-close.inc" --> > </head> > <body> >@@ -7,10 +7,13 @@ > <!-- TMPL_INCLUDE NAME="header.inc" --> > <!-- TMPL_INCLUDE NAME="cat-search.inc" --> > >-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a> › ISBD Details for <i><!-- TMPL_VAR NAME="biblionumber" --></i></div> >+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a> › <!-- TMPL_IF NAME="unknownbiblionumber" -->Unknown record<!-- TMPL_ELSE --> ISBD Details for <i><!-- TMPL_VAR NAME="biblionumber" --></i><!-- /TMPL_IF --></div> > > <div id="doc3" class="yui-t2"> >- >+ >+<!-- TMPL_IF NAME="unknownbiblionumber" --> >+ <div class="dialog message">The record you requested does not exist (<!-- TMPL_VAR NAME="biblionumber" -->).</div> >+<!-- TMPL_ELSE --> > <div id="bd"> > <div id="yui-main"> > <div class="yui-b"> >@@ -20,11 +23,11 @@ > <!-- TMPL_VAR NAME="ISBD" --> > </div> > >- > </div> > </div> > <div class="yui-b"> > <!-- TMPL_INCLUDE NAME="biblio-view-menu.inc" --> > </div> >+<!-- /TMPL_IF --> > </div> > <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" --> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tmpl >index f9cc90d..b2d9e6e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tmpl >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tmpl >@@ -1,5 +1,5 @@ > <!-- TMPL_INCLUDE NAME="doc-head-open.inc" --> >-<title>Koha › Catalog › MARC Details for <!-- TMPL_VAR NAME="bibliotitle" --></title> >+<title>Koha › Catalog › <!-- TMPL_IF NAME="unknownbiblionumber" -->Unknown record<!-- TMPL_ELSE -->MARC Details for <!-- TMPL_VAR NAME="bibliotitle" --><!-- /TMPL_IF --></title> > <!-- TMPL_INCLUDE NAME="doc-head-close.inc" --> > <script type="text/javascript"> > //<![CDATA[ >@@ -21,10 +21,12 @@ function Changefwk(FwkList) { > <!-- TMPL_INCLUDE NAME="header.inc" --> > <!-- TMPL_INCLUDE NAME="cat-search.inc" --> > >-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a> › MARC Details for <i><!-- TMPL_VAR NAME="bibliotitle" ESCAPE="html" --></i></div> >+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a> › <!-- TMPL_IF NAME="unknownbiblionumber" -->Unknown record<!-- TMPL_ELSE -->MARC Details for <i><!-- TMPL_VAR NAME="bibliotitle" ESCAPE="html" --></i><!-- /TMPL_IF --></div> > > <div id="doc3" class="yui-t2"> >- >+<!-- TMPL_IF NAME="unknownbiblionumber" --> >+ <div class="dialog message">The record you requested does not exist (<!-- TMPL_VAR NAME="biblionumber" -->).</div> >+<!-- TMPL_ELSE --> > <div id="bd"> > <div id="yui-main"> > <div class="yui-b"> >@@ -404,5 +406,6 @@ function Changefwk(FwkList) { > <div class="yui-b"> > <!-- TMPL_INCLUDE NAME="biblio-view-menu.inc" --> > </div> >+<!-- /TMPL_IF --> > </div> > <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" --> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/labeledMARCdetail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/labeledMARCdetail.tmpl >index ce26a71..9496377 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/labeledMARCdetail.tmpl >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/labeledMARCdetail.tmpl >@@ -1,6 +1,6 @@ > <!-- TMPL_INCLUDE NAME="doc-head-open.inc" --> > >- <title>Koha › Catalog › Labeled MARC Details for <!-- TMPL_VAR NAME="bibliotitle" --></title> >+ <title>Koha › Catalog › <!-- TMPL_IF NAME="unknownbiblionumber" -->Unknown record<!-- TMPL_ELSE -->Labeled MARC Details for <!-- TMPL_VAR NAME="bibliotitle" --><!-- /TMPL_IF --></title> > > <!-- TMPL_INCLUDE NAME="doc-head-close.inc" --> > >@@ -22,10 +22,15 @@ > <div id="breadcrumbs"> > <a href="/cgi-bin/koha/mainpage.pl">Home</a> > › <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a> >- › MARC Details for <i><!-- TMPL_VAR NAME="bibliotitle" --></i> >+ › <!-- TMPL_IF NAME="unknownbiblionumber" -->Unknown record >+ <!-- TMPL_ELSE -->MARC Details for <i><!-- TMPL_VAR NAME="bibliotitle" --></i> >+ <!-- /TMPL_IF --> > </div> > > <div id="doc3" class="yui-t2"> >+<!-- TMPL_IF NAME="unknownbiblionumber" --> >+ <div class="dialog message">The record you requested does not exist (<!-- TMPL_VAR NAME="biblionumber" -->).</div> >+<!-- TMPL_ELSE --> > <div id="bd"> > <div id="yui-main"> > <div class="yui-b"> >@@ -54,5 +59,6 @@ > <!-- TMPL_INCLUDE NAME="biblio-view-menu.inc" --> > > </div> >+<!-- /TMPL_IF --> > </div> > <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" --> >-- >1.7.1 >
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 5791
:
3194
|
3272
|
3273
|
3844
|
3905
|
3938