[Bug 34146] New: How to limit number of copies?
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 Bug ID: 34146 Summary: How to limit number of copies? Change sponsored?: --- Product: Koha Version: 21.05 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Cataloging Assignee: koha-bugs@lists.koha-community.org Reporter: vbovictor@gmail.com QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl In Koha it is possible to Add an instance or choose to "Add Multiple Copies" simultaneously to a record. So far so good. More..... I had a situation where an employee mistakenly typed 800,000 copies for a record. As a result, when Koha started its automatic Indexing routine, it consumed all of the server's memory and crashed system access. When I tried to delete the 800,000 copies in batch, the system crashed. It took slow deletion from 5,000 to 5,000 to reach 800,000. Considering the aforementioned case, would any colleague know if we can limit the quantity in the option "Add Multiple Copies"? If there is no option, I believe that a configuration option to limit the entry of copies is important. Thanks, Victor -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|21.05 |master Severity|enhancement |normal --- Comment #1 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Thanks Victor for reporting this one. Moving this from enh to bug. Starting with normal, but we could raise severity still. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 --- Comment #2 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 152807 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152807&action=edit Bug 34146: Do not allow multiple copies to crash server 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> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |m.de.rooy@rijksmuseum.nl |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Trivial fix, self signoff. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Raising to major -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152807|0 |1 is obsolete| | --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 152808 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152808&action=edit Bug 34146: Do not allow multiple copies to crash server 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Someone removed this btw in js: + <!-- Add a soft-limit of 99 with a reminder about potential data entry error --> + if (f>99) { + return confirm(_("More than 99 copies will be added. Should they be added?")); -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- It seems that Bootstrap does not respect the size attribute that is present on the number_of_copies input. There is a size="2" but it does not work. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 --- Comment #8 from Owen Leonard <oleonard@myacpl.org> --- (In reply to Marcel de Rooy from comment #7)
There is a size="2" but it does not work.
It sounds like you may be thinking of the "maxlength" attribute? Size only controls the width, not the values it accepts. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 George Williams (NEKLS) <george@nekls.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |george@nekls.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Owen Leonard from comment #8)
(In reply to Marcel de Rooy from comment #7)
There is a size="2" but it does not work.
It sounds like you may be thinking of the "maxlength" attribute? Size only controls the width, not the values it accepts.
Good point. Will add maxlength. Was trying to deduct why the check was removed. Note that size for a input text has a vague connection to the number of chars according to html specs. This attribute tells the user agent the initial width of the control. The width is given in pixels except when type attribute has the value "text" or "password". In that case, its value refers to the (integer) number of characters. END QUOTE Note that it also depends on font etc. So not a good choice. Bootstrap offers other options for width too. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 --- Comment #10 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 152843 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152843&action=edit Bug 34146: Add a client-side check with maxlength too Test plan: Try to add more than 3 characters now in the number of copies. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 --- Comment #11 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 152844 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152844&action=edit Bug 34146: Counterpart for serials-edit Not only additem suffers from it. We can do the same with serials-edit. This patch adds a server-side and client-side check as we did for additem. Test plan: Receive serial with adding items. Try to add more than 999 items in number of copies. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|How to limit number of |How to limit number of |copies? |copies (on additem and | |serials-edit)? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152808|0 |1 is obsolete| | --- Comment #12 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 152845 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152845&action=edit Bug 34146: Do not allow multiple copies to crash server 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152843|0 |1 is obsolete| | --- Comment #13 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 152846 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152846&action=edit Bug 34146: Add a client-side check with maxlength too Test plan: Try to add more than 3 characters now in the number of copies. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152844|0 |1 is obsolete| | --- Comment #14 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 152847 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152847&action=edit Bug 34146: Counterpart for serials-edit Not only additem suffers from it. We can do the same with serials-edit. This patch adds a server-side and client-side check as we did for additem. Test plan: Receive serial with adding items. Try to add more than 999 items in number of copies. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 --- Comment #15 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Fixed warning on first patch: [2023/06/28 14:14:26] [WARN] CGI::param called in list context from /usr/share/koha/cataloguing/additem.pl line 241, this can lead to vulnerabilities. See the warning in "Fetching the value or values of a single named parameter" at /usr/share/perl5/CGI.pm line 414. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152845|0 |1 is obsolete| | --- Comment #16 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 152849 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152849&action=edit Bug 34146: Do not allow multiple copies to crash server 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> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152846|0 |1 is obsolete| | --- Comment #17 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 152850 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152850&action=edit Bug 34146: Add a client-side check with maxlength too Test plan: Try to add more than 3 characters now in the number of copies. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #152847|0 |1 is obsolete| | --- Comment #18 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 152851 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152851&action=edit Bug 34146: Counterpart for serials-edit Not only additem suffers from it. We can do the same with serials-edit. This patch adds a server-side and client-side check as we did for additem. Test plan: Receive serial with adding items. Try to add more than 999 items in number of copies. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 Andrew Fuerste-Henry <andrewfh@dubcolib.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrewfh@dubcolib.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |23.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 --- Comment #19 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|23.11.00 |23.11.00,23.05.02 released in| | Status|Pushed to master |Pushed to stable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 --- Comment #20 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Thanks for all the hard work! Pushed to 23.05.x for the next release -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|23.11.00,23.05.02 |23.11.00,23.05.02,22.11.08 released in| | Status|Pushed to stable |Pushed to oldstable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 --- Comment #21 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Nice work everyone! Pushed to oldstable for 22.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|How to limit number of |Add confirmation question |copies (on additem and |when more than 99 items are |serials-edit)? |to be added -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34146 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kelly@bywatersolutions.com --- Comment #22 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- *** Bug 20932 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org