Description
Amit Gupta
2013-06-15 11:34:45 UTC
Created attachment 19030 [details] [review] Max length should be 2 digit for adding multiple copies in add items page. Test Plan. 1) Create a bibliographic record. 2) Create a item record click on Add multiple copies button a text box appear please enter number of copies you want to add it will not take more than 99. I disagree with this patch, since I know libraries that need to add more than 99 items at a time. In fact, the library that sponsored the "multiple items" feature in the first place sometimes need to add more than 99 items at a time. If the functionality to set a max number of items is desired, I think it should be made a syspref, so it can be more flexible. Another option might be adding a confirmation step if more than 99 are to be added. I imagine that this is an unusual but not unknown case, so adding a single click to "You're adding 31,416 items, please confirm this is correct" might be useful. It wouldn't significantly slow down normal work, but does add a bit of validation. Hi Magnus Enger, I think system preference is a right option. User can give the max digit value according to there requirement. Can you please tell me what is the default max digit value? so i can recreate the patch. IMO, a syspref is a bad idea for a few reasons. 1) Now you're removing flexibility and making things more awkward for that time when you do need to exceed a pre-defined limit, 2) You're attempting to have people make decisions on the sorts of errors that other people are likely to make. They have no reference on this, so won't really be able to do anything meaningful with it, 3) We already have lots of system preferences and adding a new one for something that doesn't really do anything (except interfere, as in #1) seems like the wrong approach. Validate by all means, but make it a soft validation. There's no point having a hard limit. We're just trying to stop typos really. I agree with Robin on this - validate the field, don't force people to set hard limit. Liz (In reply to comment #5) > Validate by all means, but make it a soft validation. There's no point > having a hard limit. We're just trying to stop typos really. I agree with Robin too! I was thinking. Use the biblio with the most items multipled by 10 as an upper limit for items to be added? If a library has 1 item per biblio for everything in their library, what are the odds they will suddenly stock 10 items of the same biblio? You could use a quick check of the number of records in biblioitems as an upper limit. No one is going to double the size of their library in one step, except at the beginning of data entry. (In reply to M. Tompsett from comment #8) > You could use a quick check of the number of records in biblioitems as an > upper limit. No one is going to double the size of their library in one > step, except at the beginning of data entry. ... until we run into a user that wants to create a few thousand items for their photography collection or something. It could happen! I agree with Robin. A hard-coded soft limit to catch typos is fine; IMO we'd need to see a lot more evidence that this is a problem that folks run into often before we get any fancier. I also don't think it is a major bug, so I'm resetting the severity accordingly. Created attachment 31722 [details] [review] Bug 10473 - Max length should be 2 digit for adding multiple copies in add items page As per the discussion, a prompt on a hard coded soft-limit is far more acceptable as a solution. TEST PLAN --------- 0) Back up your DB. -- because a backup is always good! 1) Log in to staff client 2) Navigate to any biblio details (e.g. cgi-bin/koha/catalogue/detail.pl?biblionumber=#####) 3) Click the 'Edit' dropdown button. 4) Click 'Edit items'. 5) Click 'Add multiple items' 6) Enter a crazy high number (e.g. 999) 7) Click 'Add' -- Koha just adds it! YIKES! 8) Apply patch 9) Repeat steps 5-7 10) Click 'Cancel' -- Koha does not add the items. 11) Repeat steps 5-7 12) Click 'Ok' -- Koha does add the items. 13) run koha QA test tools 14) Restore your DB. Patch tested with a sandbox, by Nick Clemens <nick@quecheelibrary.org> Created attachment 31780 [details] [review] Bug 10473 - Max length should be 2 digit for adding multiple copies in add items page As per the discussion, a prompt on a hard coded soft-limit is far more acceptable as a solution. TEST PLAN --------- 0) Back up your DB. -- because a backup is always good! 1) Log in to staff client 2) Navigate to any biblio details (e.g. cgi-bin/koha/catalogue/detail.pl?biblionumber=#####) 3) Click the 'Edit' dropdown button. 4) Click 'Edit items'. 5) Click 'Add multiple items' 6) Enter a crazy high number (e.g. 999) 7) Click 'Add' -- Koha just adds it! YIKES! 8) Apply patch 9) Repeat steps 5-7 10) Click 'Cancel' -- Koha does not add the items. 11) Repeat steps 5-7 12) Click 'Ok' -- Koha does add the items. 13) run koha QA test tools 14) Restore your DB. Signed-off-by: Nick Clemens <nick@quecheelibrary.org> Just adding the comment that I, personally, don't like the placeholder '3' and find it confusing for the general user. I don't think it fails for that though. I also didn't run QA tools as was on sandbox I'm willing to remove the placeholder, if you prefer, Nick. I just thought by putting a single digit number, it might help unconsciously lead people to type smaller, more valid numbers. :) Fair enough, I was just thinking of the questions I anticipated from librarians in the system about why they were seeing a number there. It seemed unusual to me for Koha to suggest a value in a field, I almost wondered if it was a new default of 3 at first glance. I think it could go either way, my opinion is definitely not always the common one, or even the correct one :) Leave it for QA to weigh in? I am not fond of the placeholder neither. Magnus, Robin, Liz and Galen, can we have your point of view on this new patch? IMO it is a good compromise: it only alerts the user that he entered a huge number. (In reply to Jonathan Druart from comment #16) > I am not fond of the placeholder neither. > > Magnus, Robin, Liz and Galen, can we have your point of view on this new > patch? > IMO it is a good compromise: it only alerts the user that he entered a huge > number. THe warning/alert sounds good to me. I'd vote to get rid of the placeholder. Created attachment 31889 [details] [review] Bug 10473 - Max length should be 2 digit for adding multiple copies in add items page As per the discussion, a prompt on a hard coded soft-limit is far more acceptable as a solution. TEST PLAN --------- 0) Back up your DB. -- because a backup is always good! 1) Log in to staff client 2) Navigate to any biblio details (e.g. cgi-bin/koha/catalogue/detail.pl?biblionumber=#####) 3) Click the 'Edit' dropdown button. 4) Click 'Edit items'. 5) Click 'Add multiple items' 6) Enter a crazy high number (e.g. 999) 7) Click 'Add' -- Koha just adds it! YIKES! 8) Apply patch 9) Repeat steps 5-7 10) Click 'Cancel' -- Koha does not add the items. 11) Repeat steps 5-7 12) Click 'Ok' -- Koha does add the items. 13) run koha QA test tools 14) Restore your DB. Signed-off-by: Nick Clemens <nick@quecheelibrary.org> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Created attachment 31890 [details] [review] Bug 10473: Get rif of the placeholder This placeholder is not really relevant here. I let the RM to decide about the placeholder. I think the commit message should be rewrite too. Passed QA. Created attachment 33577 [details] [review] Bug 10473: (RM followup) small wording change Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> Patches pushed to master. Thanks Mark! |