Bugzilla – Attachment 177453 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.76 KB, created by
Roman Dolny
on 2025-02-02 17:29:08 UTC
(
hide
)
Description:
Bug 23010: Handle error in updateitem.pl and template
Filename:
MIME Type:
Creator:
Roman Dolny
Created:
2025-02-02 17:29:08 UTC
Size:
3.76 KB
patch
obsolete
>From c8892b6ac1384e905527f967e712a7b5e09f86c8 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> >--- > catalogue/moredetail.pl | 3 ++- > catalogue/updateitem.pl | 11 ++++++++--- > .../prog/en/modules/catalogue/moredetail.tt | 11 ++++++++++- > 3 files changed, 20 insertions(+), 5 deletions(-) > >diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl >index 10a1d4fe0f..8b5ffbeedf 100755 >--- a/catalogue/moredetail.pl >+++ b/catalogue/moredetail.pl >@@ -86,7 +86,7 @@ $itemnumber = $query->param('itemnumber'); > 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); > >@@ -307,6 +307,7 @@ $template->param( > ); > > $template->param( >+ withdraw_error => $withdraw_error, > ITEM_DATA => \@item_data, > moredetailview => 1, > loggedinuser => $loggedinuser, >diff --git a/catalogue/updateitem.pl b/catalogue/updateitem.pl >index cb92efbb16..2d3135cb0f 100755 >--- a/catalogue/updateitem.pl >+++ b/catalogue/updateitem.pl >@@ -86,9 +86,14 @@ elsif ( $op eq "cud-set_public_note" ) { # i.e., itemnotes parameter passed from > 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("moredetail.pl?" . $messages . "biblionumber=$biblionumber&itemnumber=$itemnumber#item$itemnumber"); >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 5a5327baca..c416c08120 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt >@@ -35,7 +35,6 @@ > [% END %] > [% END #/ WRAPPER breadcrumbs %] > [% END #/ WRAPPER sub-header.inc %] >- > <div class="main container-fluid"> > <div class="row"> > <div class="col-md-10 order-md-2 order-sm-1"> >@@ -113,6 +112,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"> > <h3 id="item[% ITEM_DAT.itemnumber | html %]"> > Barcode [% ITEM_DAT.barcode | html %] [% IF not_for_loan %][% not_for_loan_description | html %] [% END %] >-- >2.39.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 23010
:
176241
|
177299
|
177402
|
177413
|
177434
|
177435
|
177436
|
177437
|
177451
|
177452
|
177453
|
177454
|
177911
|
177912
|
177913
|
177914
|
178808