Bugzilla – Attachment 182214 Details for
Bug 23010
If an item is checked out or in transit it should not be able to be marked withdrawn
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23010: Handle error in updateitem.pl and template
Bug-23010-Handle-error-in-updateitempl-and-templat.patch (text/plain), 3.66 KB, created by
Emily Lamancusa (emlam)
on 2025-05-09 17:50:28 UTC
(
hide
)
Description:
Bug 23010: Handle error in updateitem.pl and template
Filename:
MIME Type:
Creator:
Emily Lamancusa (emlam)
Created:
2025-05-09 17:50:28 UTC
Size:
3.66 KB
patch
obsolete
>From 90f76795af5e488979cfd7a9b5311e29e3b81bdd Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Fri, 31 Jan 2025 19:02:04 +0000 >Subject: [PATCH] Bug 23010: Handle error in updateitem.pl and template > >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> >--- > catalogue/moredetail.pl | 9 +++++---- > catalogue/updateitem.pl | 10 +++++++--- > .../prog/en/modules/catalogue/moredetail.tt | 10 ++++++++++ > 3 files changed, 22 insertions(+), 7 deletions(-) > >diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl >index 3e848377bc..78688a925d 100755 >--- a/catalogue/moredetail.pl >+++ b/catalogue/moredetail.pl >@@ -81,9 +81,10 @@ my $title = $query->param('title'); > my $bi = $query->param('bi'); > $bi = $biblionumber unless $bi; > $itemnumber = $query->param('itemnumber'); >-my $data = &GetBiblioData($biblionumber); >-my $dewey = $data->{'dewey'}; >-my $showallitems = $query->param('showallitems'); >+my $data = &GetBiblioData($biblionumber); >+my $dewey = $data->{'dewey'}; >+my $showallitems = $query->param('showallitems'); >+my $withdraw_error = $query->param('nowithdraw'); > > #coping with subscriptions > my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber); >@@ -325,6 +326,7 @@ $template->param( > ); > > $template->param( >+ withdraw_error => $withdraw_error, > ITEM_DATA => \@item_data, > moredetailview => 1, > loggedinuser => $loggedinuser, >@@ -341,4 +343,3 @@ my $holds = $biblio->holds; > $template->param( holdcount => $holds->count ); > > output_html_with_http_headers $query, $cookie, $template->output; >- >diff --git a/catalogue/updateitem.pl b/catalogue/updateitem.pl >index 350f4b14e4..d02fe66951 100755 >--- a/catalogue/updateitem.pl >+++ b/catalogue/updateitem.pl >@@ -90,9 +90,13 @@ if ( $op eq "cud-set_non_public_note" ) { > print $cgi->redirect("moredetail.pl?biblionumber=$biblionumber&itemnumber=$itemnumber#item$itemnumber"); > exit; > } >- >-$item->store; >- >+eval { $item->store; }; >+if ($@) { >+ my $error_message = $@->message; >+ print $cgi->redirect( >+ "moredetail.pl?biblionumber=$biblionumber&itemnumber=$itemnumber&nowithdraw=$error_message#item$itemnumber"); >+ exit; >+} > LostItem( $itemnumber, 'moredetail' ) if $op eq "cud-set_lost"; > > print $cgi->redirect( >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >index e6ca9c6ae9..2a3d57d1ff 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >@@ -152,6 +152,16 @@ > [% SET not_for_loan = 1 %] > [% SET not_for_loan_description = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %] > [% END %] >+ [% IF withdraw_error %] >+ <div class="alert alert-info"> >+ [% IF withdraw_error == 'intransit_cannot_withdraw' %] >+ Cannot withdraw item in transit. >+ [% END %] >+ [% IF withdraw_error == 'onloan_cannot_withdraw' %] >+ Cannot withdraw checked out item. >+ [% END %] >+ </div> >+ [% END %] > <div class="listgroup"> > <h4> > Item information >-- >2.34.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 23010
:
176241
|
177299
|
177402
|
177413
|
177434
|
177435
|
177436
|
177437
|
177451
|
177452
|
177453
|
177454
|
177911
|
177912
|
177913
|
177914
|
178808
|
181322
|
181323
|
181324
|
181325
|
181326
|
181327
|
181400
|
182124
|
182129
|
182130
|
182131
|
182201
|
182212
|
182213
| 182214 |
182215
|
182216
|
182217
|
182218
|
182219
|
182220
|
182221
|
182222
|
182223
|
182224