Bugzilla – Attachment 152807 Details for
Bug 34146
Add confirmation question when more than 99 items are to be added
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34146: Do not allow multiple copies to crash server
Bug-34146-Do-not-allow-multiple-copies-to-crash-se.patch (text/plain), 2.78 KB, created by
Marcel de Rooy
on 2023-06-28 14:17:24 UTC
(
hide
)
Description:
Bug 34146: Do not allow multiple copies to crash server
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-06-28 14:17:24 UTC
Size:
2.78 KB
patch
obsolete
>From 9536268e4415ff65098059b84a8c7df752229067 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 28 Jun 2023 14:14:51 +0000 >Subject: [PATCH] Bug 34146: Do not allow multiple copies to crash server >Content-Type: text/plain; charset=utf-8 > >Currently hardcoded to 1000. >Can be refined later. Let's first prevent this kind of accidents. > >Test plan: >Add additem.pl. Edit the 1000 to 2. Restart all. >Add 3 multiple copies. Notice that you got 2. >Revert your code change. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > cataloguing/additem.pl | 4 ++-- > .../intranet-tmpl/prog/en/modules/cataloguing/additem.tt | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index 4630eec0a4..e0844149fe 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -45,7 +45,7 @@ use Koha::Result::Boolean; > > use Encode qw( encode_utf8 ); > use List::MoreUtils qw( any uniq ); >-use List::Util qw( first ); >+use List::Util qw( first min ); > use MARC::File::XML; > use MIME::Base64 qw( decode_base64url encode_base64url ); > use Storable qw( freeze thaw ); >@@ -238,7 +238,7 @@ if ($op eq "additem") { > my $add_duplicate_submit = $input->param('add_duplicate_submit'); > my $add_multiple_copies_submit = $input->param('add_multiple_copies_submit'); > my $save_as_template_submit = $input->param('save_as_template_submit'); >- my $number_of_copies = $input->param('number_of_copies'); >+ my $number_of_copies = min( $input->param('number_of_copies'), 2 ); # TODO refine hardcoded maximum? > > my @columns = Koha::Items->columns; > my $item = Koha::Item->new; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >index 2401c4f3fb..4c349b37db 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >@@ -286,7 +286,7 @@ > <label for="number_of_copies">Number of copies of this item to add: </label> > <input type="text" id="number_of_copies" name="number_of_copies" value="" size="2" /> > <input type="submit" id="add_multiple_copies_submit" name="add_multiple_copies_submit" value="Add" onclick="javascript:return Check(this.form) && CheckMultipleAdd(this.form.number_of_copies.value);" /> <a href="#" id="cancel_add_multiple" class="cancel">Cancel</a> >- <div class="hint"><p>The barcode you enter will be incremented for each additional item.</p></div> >+ <div class="hint"><p>Maximum currently set to 1000. The barcode you enter will be incremented for each additional item.</p></div> > </fieldset> > > <span id="savetemplate"> >-- >2.30.2
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 34146
:
152807
|
152808
|
152843
|
152844
|
152845
|
152846
|
152847
|
152849
|
152850
|
152851