Bugzilla – Attachment 11358 Details for
Bug 8572
Attempting to view an invalid authority in the OPAC gives an error instead of 404
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8572: invalid auth shouldn't cause error
Bug-8572-invalid-auth-shouldnt-cause-error.patch (text/plain), 1.91 KB, created by
Jared Camins-Esakov
on 2012-08-04 17:44:29 UTC
(
hide
)
Description:
Bug 8572: invalid auth shouldn't cause error
Filename:
MIME Type:
Creator:
Jared Camins-Esakov
Created:
2012-08-04 17:44:29 UTC
Size:
1.91 KB
patch
obsolete
>From 196e8db0f7a5918c9c07fd989ee7ce4ea936e8a8 Mon Sep 17 00:00:00 2001 >From: Jared Camins-Esakov <jcamins@cpbibliography.com> >Date: Sat, 4 Aug 2012 13:48:00 -0400 >Subject: [PATCH] Bug 8572: invalid auth shouldn't cause error >Content-Type: text/plain; charset="UTF-8" > >Prior to this patch, attempting to view an invalid authority in the >OPAC gave a system error instead of a 404. With this patch, the user >will just get a 404, as is the case with invalid bibs. > >To test: >1) Try to view an invalid authority by going to: > /cgi-bin/koha/opac-authoritiesdetail.pl?authid=999999999999 > (presuming that you don't have an authority with authid 999999999999 > in your database) before and after applying this patch >--- > opac/opac-authoritiesdetail.pl | 11 ++++++----- > 1 files changed, 6 insertions(+), 5 deletions(-) > >diff --git a/opac/opac-authoritiesdetail.pl b/opac/opac-authoritiesdetail.pl >index 278db99..8d5367f 100755 >--- a/opac/opac-authoritiesdetail.pl >+++ b/opac/opac-authoritiesdetail.pl >@@ -67,9 +67,14 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > ); > > my $authid = $query->param('authid'); >+my $record = GetAuthority( $authid ); >+if ( ! $record ) { >+ print $query->redirect("/cgi-bin/koha/errors/404.pl"); # escape early >+ exit; >+} >+ > my $authtypecode = &GetAuthTypeCode( $authid ); > >-my $record; > if ($display_hierarchy){ > my $trees=BuildUnimarcHierarchies($authid); > my @trees = split /;/,$trees ; >@@ -83,7 +88,6 @@ if ($display_hierarchy){ > foreach my $element (@tree){ > my $cell; > my $elementdata = GetAuthority($element); >- $record= $elementdata if ($authid==$element); > push @loophierarchy, BuildUnimarcHierarchy($elementdata,"child".$cnt, $authid); > $cnt++; > } >@@ -94,9 +98,6 @@ if ($display_hierarchy){ > 'loophierarchies' =>\@loophierarchies, > ); > } >-else { >- $record = GetAuthority( $authid ); >-} > my $count = CountUsage($authid); > > >-- >1.7.2.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 8572
:
11358
|
11371