Description
Jonathan Druart
2015-08-27 08:28:43 UTC
Actually it's even worst, a new batch is created for each user you add. Note that this bug existed before bug 13891 (so in 3.18.x) Introduced by commit 2dd97f26c1e72bc35e29b1afd1fc38d301c48e9e Bug 12911: batch_id for new labels batches can be asssigned to several batches exists since 3.18.7. *** Bug 14700 has been marked as a duplicate of this bug. *** I tried an easy fix (update batch_id after adding an item), but if a user clicks on several patrons to add without waiting for background page to reload the batch_id doesn't have time to update. Barton said he is taking a look today and I will touch base with him when I get in this afternoon I think the easier and cleaner way to do would be to create (and so get an id) the batch when the "Add items" button is clicked. It's not perfect, but I don't see another way. Created attachment 42421 [details] [review] Obsoleted patch copied from bug 12911 I tried my best to find a workaround on top of my patches, but couldn't make anything work. Requiring items to be added before assigning a batch number meant I would have needed to create a placeholder item to get an id. Thomas' patches on 12911 did just that. You can push up the batch number by creating a new batch and never adding to it, but that seems okay Also "Select", "Select all", "Select none" checkbox and links are missing. See attached image. Created attachment 42445 [details]
Selection links are missing
Created attachment 42473 [details] [review] Bug 14739 - Add several patrons to a new batch will create a new batch per patron added This patch changes the functionality of adding patrons to patroncard batches. Instead of using only the patron searhc, there is now a textarea which can either be manually populated with borrowernumbers, or can be populated using the patron-search To test: 1 - Create a new patron batch 2 - Click the add items button, if there is no data in the borrowrnumber form you should get a popupo 3 - Add items to batch using the popup, borrowernumbers should populate to the form 4 - Click add items again and items hsoul;d be added to a new batch 5 - Create a new batch 6 - Manually enter invalid borrowernumbers to the form 7 - Click add items, batch should return empty 8 - Manually enter valid borrowernumber 9 - Click add items, batch should be updated 10 - Edit an existing batch and confirm add items works as above *** Bug 14800 has been marked as a duplicate of this bug. *** Created attachment 42474 [details] [review] [Signed-off] Bug 14739 - Add several patrons to a new batch will create a new batch per patron added This patch changes the functionality of adding patrons to patroncard batches. Instead of using only the patron searhc, there is now a textarea which can either be manually populated with borrowernumbers, or can be populated using the patron-search To test: 1 - Create a new patron batch 2 - Click the add items button, if there is no data in the borrowrnumber form you should get a popupo 3 - Add items to batch using the popup, borrowernumbers should populate to the form 4 - Click add items again and items hsoul;d be added to a new batch 5 - Create a new batch 6 - Manually enter invalid borrowernumbers to the form 7 - Click add items, batch should return empty 8 - Manually enter valid borrowernumber 9 - Click add items, batch should be updated 10 - Edit an existing batch and confirm add items works as above Followed test plan, works as expected. Signed-off-by: Marc Véron <veron@veron.ch> BTW: A couple of months ago, I implemented a possibility to print patron cards from patronlists. Patron lists are easier to create and to handle. See Bug 14131 (Needs sign-off) *** Bug 14123 has been marked as a duplicate of this bug. *** Why do you use "barcode" when manipulating "borrowernumber"? Did you note that the same issue appears for labels? Created attachment 42623 [details] [review] Bug 14739 - Add several patrons to a new batch will create a new batch per patron added This patch changes the functionality of adding patrons to patroncard batches. Instead of using only the patron searhc, there is now a textarea which can either be manually populated with borrowernumbers, or can be populated using the patron-search To test: 1 - Create a new patron batch 2 - Click the add items button, if there is no data in the borrowrnumber form you should get a popupo 3 - Add items to batch using the popup, borrowernumbers should populate to the form 4 - Click add items again and items hsoul;d be added to a new batch 5 - Create a new batch 6 - Manually enter invalid borrowernumbers to the form 7 - Click add items, batch should return empty 8 - Manually enter valid borrowernumber 9 - Click add items, batch should be updated 10 - Edit an existing batch and confirm add items works as above 11 - Create a new label batch 12 - Click add items with no data, popup item search should appear 13 - Adding items by checking boxes or using 'Add' button - they should populate the text box on the edit batch page 14 - When adding using form the 'Enter by itemnumber' button should be marked automatically 15 - Submit items and confirm they are added to batch 16 - Create a new batch, enter by barcode manually and check 'Enter by itemnumber" 17 - Click add items, no items should be added 18 - Repopulate form with barcodes, check 'Enter by barcode' 19 - Click add items, items should be added correctly 20 - Test various combinations of radio buttons and numbers and using form or not I have problem on numbers 6-7 of test plan, when I entered invalid borrowernumbers, the new batch was created, but it wasn't empty, but there are exactly the same borrowers as in previous batch... they were somehow copied from the first batch to second one... Then I tried to delete four items of this batch, with success, then I tried to add valid number and it was added ok, but again all items from first batch was added too... on label batches this works correctly Created attachment 42965 [details] [review] Bug 14739 - Add several patrons to a new batch will create a new batch per patron added This patch changes the functionality of adding patrons to patroncard batches. Instead of using only the patron search, there is now a textarea which can either be manually populated with borrowernumbers, or can be populated using the patron-search To test: 1 - Create a new patron batch 2 - Click the add items button, if there is no data in the borrowrnumber form you should get a popup 3 - Add items to batch using the popup, borrowernumbers should populate to the form 4 - Click add items again and items should be added to a new batch 5 - Create a new batch 6 - Manually enter invalid borrowernumbers to the form 7 - Click add items, batch should return empty 8 - Manually enter valid borrowernumber 9 - Click add items, batch should be updated 10 - Edit an existing batch and confirm add items works as above 11 - Create a new label batch 12 - Click add items with no data, popup item search should appear 13 - Adding items by checking boxes or using 'Add' button - they should populate the text box on the edit batch page 14 - When adding using form the 'Enter by itemnumber' button should be marked automatically 15 - Submit items and confirm they are added to batch 16 - Create a new batch, enter by barcode manually and check 'Enter by itemnumber" 17 - Click add items, no items should be added 18 - Repopulate form with barcodes, check 'Enter by barcode' 19 - Click add items, items should be added correctly 20 - Test various combinations of radio buttons and numbers and using form or not (In reply to Josef Moravec from comment #16) > I have problem on numbers 6-7 of test plan, I couldn't recreate, but I added a safeguard against there being items saved in batch 0 which could have caused the error. Can you retest and let me know if it happens again? I also cleaned up some debug code I found left behind. I'm sorry but I still have problems.... Try this: 1. Go to patron label creator -> manage batches 2. Remove all batches (just to be sure we have the same environment) 3. Click on "new batch" 4. Click on "add items" and pick 5 patrons 5. Close the patron picker window and click on "add items" again, the batch is created as expected 6. Go back to manage batches 7. Click on "new batch" 8. insert one right borrowernumber and one wrong borrowernumber 9. click on "add items" 10. the one right is added, but the five patrons from previous batch is added too (In reply to Josef Moravec from comment #19) > I'm sorry but I still have problems.... > I tested again in my VM and on a sandbox and cannot recreate. What environment are you testing in? I have VM with Debian Jessie, but with MariaDB instead of MySQL... I'll try it on another machine with MySQL tomorow... (In reply to Josef Moravec from comment #21) > I have VM with Debian Jessie, but with MariaDB instead of MySQL... I'll try > it on another machine with MySQL tomorow... Using MariaDB I don't get the issue you have described. Hm, on another machine everything works perfect... So probably some problem with my specific data, or something on that one VM. So please, ignore me ;) Josef, if you are still able to reproduce the issue, with the last patches against master, I think we should try to understand what is the problem :) Could you confirm you got the issue even with a non-empty creator_batches table? I have not tried with en empty table. I tried it on non-empty table, but have the same issue... I am not able to figure out where is the problem.... Getting Software error: Can't call method "get_attr" without a package or object reference at /home/barton/kohaclone/patroncards/edit-batch.pl line 125. To re-create: 1/ go to Home › Tools › Patron card creator › Manage card Batches (cgi-bin/koha/patroncards/manage.pl?card_element=batch) 2/ click 'New Bath' (cgi-bin/koha/patroncards/edit-batch.pl?op=new) 3/ click 'Add items' (opens new window -- cgi-bin/koha/patroncards/add_user_search.pl) 4/ click 'Search' to show all patrons (I don't have that many) 5/ click 'Add' on first patron -> Software error. (In reply to Barton Chittenden from comment #26) > Getting > > Software error: > > Can't call method "get_attr" without a package or object reference at > /home/barton/kohaclone/patroncards/edit-batch.pl line 125. > > To re-create: > > 1/ go to Home › Tools › Patron card creator › Manage card Batches > (cgi-bin/koha/patroncards/manage.pl?card_element=batch) > 2/ click 'New Bath' (cgi-bin/koha/patroncards/edit-batch.pl?op=new) > 3/ click 'Add items' (opens new window -- > cgi-bin/koha/patroncards/add_user_search.pl) > 4/ click 'Search' to show all patrons (I don't have that many) > 5/ click 'Add' on first patron -> Software error. This was user error on my part. Created attachment 43034 [details] [review] Bug 14739 - Add several patrons to a new batch will create a new batch per patron added This patch changes the functionality of adding patrons to patroncard batches. Instead of using only the patron search, there is now a textarea which can either be manually populated with borrowernumbers, or can be populated using the patron-search To test: 1 - Create a new patron batch 2 - Click the add items button, if there is no data in the borrowrnumber form you should get a popup 3 - Add items to batch using the popup, borrowernumbers should populate to the form 4 - Click add items again and items should be added to a new batch 5 - Create a new batch 6 - Manually enter invalid borrowernumbers to the form 7 - Click add items, batch should return empty 8 - Manually enter valid borrowernumber 9 - Click add items, batch should be updated 10 - Edit an existing batch and confirm add items works as above 11 - Create a new label batch 12 - Click add items with no data, popup item search should appear 13 - Adding items by checking boxes or using 'Add' button - they should populate the text box on the edit batch page 14 - When adding using form the 'Enter by itemnumber' button should be marked automatically 15 - Submit items and confirm they are added to batch 16 - Create a new batch, enter by barcode manually and check 'Enter by itemnumber" 17 - Click add items, no items should be added 18 - Repopulate form with barcodes, check 'Enter by barcode' 19 - Click add items, items should be added correctly 20 - Test various combinations of radio buttons and numbers and using form or not Created attachment 43038 [details] [review] Bug 14739 - Add several patrons to a new batch will create a new batch per patron added This patch changes the functionality of adding patrons to patroncard batches. Instead of using only the patron search, there is now a textarea which can either be manually populated with borrowernumbers, or can be populated using the patron-search To test: 1 - Create a new patron batch 2 - Click the add items button, if there is no data in the borrowrnumber form you should get a popup 3 - Add items to batch using the popup, borrowernumbers should populate to the form 4 - Click add items again and items should be added to a new batch 5 - Create a new batch 6 - Manually enter invalid borrowernumbers to the form 7 - Click add items, batch should return empty 8 - Manually enter valid borrowernumber 9 - Click add items, batch should be updated 10 - Edit an existing batch and confirm add items works as above 11 - Create a new label batch 12 - Click add items with no data, popup item search should appear 13 - Adding items by checking boxes or using 'Add' button - they should populate the text box on the edit batch page 14 - When adding using form the 'Enter by itemnumber' button should be marked automatically 15 - Submit items and confirm they are added to batch 16 - Create a new batch, enter by barcode manually and check 'Enter by itemnumber" 17 - Click add items, no items should be added 18 - Repopulate form with barcodes, check 'Enter by barcode' 19 - Click add items, items should be added correctly 20 - Test various combinations of radio buttons and numbers and using form or not Created attachment 43040 [details] [review] [SIGNED-OFF] Bug 14739 - Add several patrons to a new batch will create a new batch per patron added This patch changes the functionality of adding patrons to patroncard batches. Instead of using only the patron search, there is now a textarea which can either be manually populated with borrowernumbers, or can be populated using the patron-search To test: 1 - Create a new patron batch 2 - Click the add items button, if there is no data in the borrowrnumber form you should get a popup 3 - Add items to batch using the popup, borrowernumbers should populate to the form 4 - Click add items again and items should be added to a new batch 5 - Create a new batch 6 - Manually enter invalid borrowernumbers to the form 7 - Click add items, batch should return empty 8 - Manually enter valid borrowernumber 9 - Click add items, batch should be updated 10 - Edit an existing batch and confirm add items works as above 11 - Create a new label batch 12 - Click add items with no data, popup item search should appear 13 - Adding items by checking boxes or using 'Add' button - they should populate the text box on the edit batch page 14 - When adding using form the 'Enter by itemnumber' button should be marked automatically 15 - Submit items and confirm they are added to batch 16 - Create a new batch, enter by barcode manually and check 'Enter by itemnumber" 17 - Click add items, no items should be added 18 - Repopulate form with barcodes, check 'Enter by barcode' 19 - Click add items, items should be added correctly 20 - Test various combinations of radio buttons and numbers and using form or not Signed-off-by: Barton Chittenden <barton@bywatersolutions.com> (In reply to Barton Chittenden from comment #30) > Created attachment 43040 [details] [review] [review] > [SIGNED-OFF] Bug 14739 - Add several patrons to a new batch will create a > new batch per patron added > > This patch changes the functionality of adding patrons to patroncard > batches. Instead of using only the patron search, there is now a textarea > which can either be manually populated with borrowernumbers, or can be > populated using the patron-search > > To test: > 1 - Create a new patron batch > 2 - Click the add items button, if there is no data in the borrowrnumber > form you should get a popup > 3 - Add items to batch using the popup, borrowernumbers should populate to > the form > 4 - Click add items again and items should be added to a new batch > 5 - Create a new batch > 6 - Manually enter invalid borrowernumbers to the form > 7 - Click add items, batch should return empty > 8 - Manually enter valid borrowernumber > 9 - Click add items, batch should be updated > 10 - Edit an existing batch and confirm add items works as above > 11 - Create a new label batch > 12 - Click add items with no data, popup item search should appear > 13 - Adding items by checking boxes or using 'Add' button - they should > populate the text box on the edit batch page > 14 - When adding using form the 'Enter by itemnumber' button should be > marked automatically > 15 - Submit items and confirm they are added to batch > 16 - Create a new batch, enter by barcode manually and check 'Enter by > itemnumber" > 17 - Click add items, no items should be added > 18 - Repopulate form with barcodes, check 'Enter by barcode' > 19 - Click add items, items should be added correctly > 20 - Test various combinations of radio buttons and numbers and using form > or not > > Signed-off-by: Barton Chittenden <barton@bywatersolutions.com> I've tested without error, and I'm signing off, but I know that Jonathan wants to see if we can replicate the errors that Josef Moravec was seeing, so I'm not going to set the status of the bug as a whole to 'Signed Off'. This is simply saying 'the patch works for me'. Now I now where is the difference. It's plack! When I stop using plack, everything works as expected. Created attachment 43050 [details] [review] Bug 14739: Fix plack compatibility perlcritic raised "Declare variables outside of the condition" (In reply to Josef Moravec from comment #32) > Now I now where is the difference. It's plack! > > When I stop using plack, everything works as expected. hehe, thanks Josef! Here is a patch! Created attachment 43052 [details] [review] [SIGNED-OFF] Bug 14739: Fix plack compatibility perlcritic raised "Declare variables outside of the condition" Works as expected Signed-off-by: Josef Moravec <josef.moravec@gmail.com> It works like a charm ;) Thank you Jonathan There is something wrong in the first patch 59 my @item_numbers; #= $cgi->param('item_number') if $cgi->param('item_number'); Could someone re-upload a valid patch? Sorry, I did a mistake with obsoleting patches, now it should be OK, could you try it again please? The second patch does not apply anymore, but maybe it was not based on the good one. Created attachment 43060 [details] [review] Bug 14739 - Add several patrons to a new batch will create a new batch per patron added This patch changes the functionality of adding patrons to patroncard batches. Instead of using only the patron search, there is now a textarea which can either be manually populated with borrowernumbers, or can be populated using the patron-search To test: 1 - Create a new patron batch 2 - Click the add items button, if there is no data in the borrowrnumber form you should get a popup 3 - Add items to batch using the popup, borrowernumbers should populate to the form 4 - Click add items again and items should be added to a new batch 5 - Create a new batch 6 - Manually enter invalid borrowernumbers to the form 7 - Click add items, batch should return empty 8 - Manually enter valid borrowernumber 9 - Click add items, batch should be updated 10 - Edit an existing batch and confirm add items works as above 11 - Create a new label batch 12 - Click add items with no data, popup item search should appear 13 - Adding items by checking boxes or using 'Add' button - they should populate the text box on the edit batch page 14 - When adding using form the 'Enter by itemnumber' button should be marked automatically 15 - Submit items and confirm they are added to batch 16 - Create a new batch, enter by barcode manually and check 'Enter by itemnumber" 17 - Click add items, no items should be added 18 - Repopulate form with barcodes, check 'Enter by barcode' 19 - Click add items, items should be added correctly 20 - Test various combinations of radio buttons and numbers and using form or not Signed-off-by: Barton Chittenden <barton@bywatersolutions.com> Created attachment 43061 [details] [review] Bug 14739: Fix plack compatibility perlcritic raised "Declare variables outside of the condition" Works as expected Signed-off-by: Josef Moravec <josef.moravec@gmail.com> I rebased the patches in my local branch, could you please check if it's OK? From the first patch: -my $batch_id = $cgi->param('element_id') || $cgi->param('batch_id') || undef; +my $batch_id = $cgi->param('element_id') || $cgi->param('batch_id') || 0; From the second patch: -my $batch_id = $cgi->param('element_id') || $cgi->param('batch_id') || 0; +my $batch_id = $cgi->param('element_id') || $cgi->param('batch_id') || undef; Initially my patch (the second one) didn't modify this line. Created attachment 43062 [details] [review] Bug 14739 - Add several patrons to a new batch will create a new batch per patron added This patch changes the functionality of adding patrons to patroncard batches. Instead of using only the patron search, there is now a textarea which can either be manually populated with borrowernumbers, or can be populated using the patron-search To test: 1 - Create a new patron batch 2 - Click the add items button, if there is no data in the borrowrnumber form you should get a popup 3 - Add items to batch using the popup, borrowernumbers should populate to the form 4 - Click add items again and items should be added to a new batch 5 - Create a new batch 6 - Manually enter invalid borrowernumbers to the form 7 - Click add items, batch should return empty 8 - Manually enter valid borrowernumber 9 - Click add items, batch should be updated 10 - Edit an existing batch and confirm add items works as above 11 - Create a new label batch 12 - Click add items with no data, popup item search should appear 13 - Adding items by checking boxes or using 'Add' button - they should populate the text box on the edit batch page 14 - When adding using form the 'Enter by itemnumber' button should be marked automatically 15 - Submit items and confirm they are added to batch 16 - Create a new batch, enter by barcode manually and check 'Enter by itemnumber" 17 - Click add items, no items should be added 18 - Repopulate form with barcodes, check 'Enter by barcode' 19 - Click add items, items should be added correctly 20 - Test various combinations of radio buttons and numbers and using form or not Signed-off-by: Barton Chittenden <barton@bywatersolutions.com> Created attachment 43063 [details] [review] Bug 14739: Fix plack compatibility perlcritic raised "Declare variables outside of the condition" Works as expected Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Is that better? I am sorry for this inconvenience... Created attachment 43107 [details] [review] Bug 14739 - Add several patrons to a new batch will create a new batch per patron added This patch changes the functionality of adding patrons to patroncard batches. Instead of using only the patron search, there is now a textarea which can either be manually populated with borrowernumbers, or can be populated using the patron-search To test: 1 - Create a new patron batch 2 - Click the add items button, if there is no data in the borrowrnumber form you should get a popup 3 - Add items to batch using the popup, borrowernumbers should populate to the form 4 - Click add items again and items should be added to a new batch 5 - Create a new batch 6 - Manually enter invalid borrowernumbers to the form 7 - Click add items, batch should return empty 8 - Manually enter valid borrowernumber 9 - Click add items, batch should be updated 10 - Edit an existing batch and confirm add items works as above 11 - Create a new label batch 12 - Click add items with no data, popup item search should appear 13 - Adding items by checking boxes or using 'Add' button - they should populate the text box on the edit batch page 14 - When adding using form the 'Enter by itemnumber' button should be marked automatically 15 - Submit items and confirm they are added to batch 16 - Create a new batch, enter by barcode manually and check 'Enter by itemnumber" 17 - Click add items, no items should be added 18 - Repopulate form with barcodes, check 'Enter by barcode' 19 - Click add items, items should be added correctly 20 - Test various combinations of radio buttons and numbers and using form or not Signed-off-by: Barton Chittenden <barton@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 43108 [details] [review] Bug 14739: Fix plack compatibility perlcritic raised "Declare variables outside of the condition" Works as expected Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 43109 [details] [review] Bug 14739: Adapt wording in breadcrumbs if a new batch is created Don't display "Manage batch number 0" but "Create new batch" Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Patches pushed to master. Thanks Nick! Hi, If you feel like it, a version of this for 3.18 would be pretty nice, as this one doesn't apply cleanly. (Maybe I'll have a look, but don't count on it!) Cheers, Liz This change might require documentation updates. Created attachment 44663 [details] [review] [3.18.x rewrite] Bug 14739 - Add several patrons to a new batch will create a new batch per patron added This patch changes the functionality of adding patrons to patroncard batches. Instead of using only the patron search, there is now a textarea which can either be manually populated with borrowernumbers, or can be populated using the patron-search To test: 1 - Create a new patron batch 2 - Click the add items button, if there is no data in the borrowrnumber form you should get a popup 3 - Add items to batch using the popup, borrowernumbers should populate to the form 4 - Click add items again and items should be added to a new batch 5 - Create a new batch 6 - Manually enter invalid borrowernumbers to the form 7 - Click add items, batch should return empty 8 - Manually enter valid borrowernumber 9 - Click add items, batch should be updated 10 - Edit an existing batch and confirm add items works as above 11 - Create a new label batch 12 - Click add items with no data, popup item search should appear 13 - Adding items by checking boxes or using 'Add' button - they should populate the text box on the edit batch page 14 - When adding using form the 'Enter by itemnumber' button should be marked automatically 15 - Submit items and confirm they are added to batch 16 - Create a new batch, enter by barcode manually and check 'Enter by itemnumber" 17 - Click add items, no items should be added 18 - Repopulate form with barcodes, check 'Enter by barcode' 19 - Click add items, items should be added correctly 20 - Test various combinations of radio buttons and numbers and using form or not Signed-off-by: Barton Chittenden <barton@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> I'm wondering if this can get pushed into 3.18? *** Bug 15393 has been marked as a duplicate of this bug. *** Pushed to 3.18.13, and released. |