Bugzilla – Attachment 67212 Details for
Bug 16204
Show friendly error message when trying to edit record which no longer exists
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16204: Show friendly error message if trying to edit record which no longer exists
Bug-16204-Show-friendly-error-message-if-trying-to.patch (text/plain), 2.92 KB, created by
Jonathan Druart
on 2017-09-19 14:23:37 UTC
(
hide
)
Description:
Bug 16204: Show friendly error message if trying to edit record which no longer exists
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-09-19 14:23:37 UTC
Size:
2.92 KB
patch
obsolete
>From cee115e7972497dae62153ba330225937dd70716 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Wed, 30 Aug 2017 04:36:50 +0000 >Subject: [PATCH] Bug 16204: Show friendly error message if trying to edit > record which no longer exists > >To test: >1) Create a record >2) Click Edit -> Edit record. open this in another tab >3) Delete the record in the original tab >4) Refresh the edit form in the other tab. Notice the software error >5) Apply patch and refresh page >6) There should be a nice error message with the form fields and buttons >hidden. Confirm links work as expected. > >Sponsored-by: Catalyst IT >Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > cataloguing/addbiblio.pl | 10 +++++++++- > .../intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt | 13 +++++++++++++ > 2 files changed, 22 insertions(+), 1 deletion(-) > >diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl >index b72d71f33a..cfb112eebc 100755 >--- a/cataloguing/addbiblio.pl >+++ b/cataloguing/addbiblio.pl >@@ -730,6 +730,14 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > } > ); > >+if ($biblionumber){ >+ my $does_bib_exist = Koha::Biblios->find($biblionumber); >+ if (!defined $does_bib_exist){ >+ $biblionumber = undef; >+ $template->param( bib_doesnt_exist => 1 ); >+ } >+} >+ > if ($frameworkcode eq 'FA'){ > # We need to grab and set some variables in the template for use on the additems screen > $template->param( >@@ -798,7 +806,7 @@ if ($parentbiblio) { > } > > $is_a_modif = 0; >- >+ > if ($biblionumber) { > $is_a_modif = 1; > my $title = C4::Context->preference('marcflavour') eq "UNIMARC" ? $record->subfield('200', 'a') : $record->title; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >index 7a50096593..4b4516dbe3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >@@ -18,6 +18,12 @@ > $("#loading").hide(); > }); > $(document).ready(function() { >+ >+ [% IF bib_doesnt_exist %] >+ $("#addbibliotabs").hide(); >+ $("#toolbar").hide(); >+ [% END %] >+ > $('#addbibliotabs').tabs().bind('show.ui-tabs', function(e, ui) { > $("#"+ui.panel.id+" input:eq(0)").focus(); > }); >@@ -540,6 +546,13 @@ function Changefwk() { > [% END %] > </div> > >+[% IF bib_doesnt_exist %] >+ <div class="dialog alert"> >+ The record you are trying to edit doesn't exist.<br> >+ <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=">Add a new record</a> or <a href="/cgi-bin/koha/catalogue/search.pl">do a catalog search</a>. >+ </div> >+[% END %] >+ > [% IF ( popup ) %] > <input type="hidden" name="mode" value="popup" /> > [% END %] >-- >2.11.0
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 16204
:
66608
|
67072
| 67212