Bug 10163

Summary: batch-mod items tool fails on files over 1000 lines long
Product: Koha Reporter: Mason James <mtj>
Component: CatalogingAssignee: Colin Campbell <colin.campbell>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P5 - low CC: colin.campbell, dcook, f.demians, fridolin.somers, gwilliams, jonathan.druart, m.de.rooy, marjorie.barry-vila
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11343
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11490
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26298
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 11490    
Bug Blocks:    
Attachments: pic
proposed patch
Screenshot of batch operation after applying the patch
Bug 10163 - batch-mod items tool fails on files over 1000 lines long
[SIGNED-OFF] Bug 10163 - batch-mod items tool fails on files over 1000 lines long

Description Mason James 2013-05-01 01:28:33 UTC
if you attempt to upload a file with more than 1000 lines, you get an error...

----------------------------------------
Batch item modification - Too many items (1001): not displaying each one individually.

Return to batch item modification
----------------------------------------


looking that the code its obvious that the intended behavior is to not display the items, yet still allow the items to be edited

this functionality seems broken
Comment 1 Mason James 2013-05-01 01:30:54 UTC
Created attachment 17859 [details]
pic
Comment 2 Colin Campbell 2013-05-20 14:27:57 UTC
Just confirmed with a customer that this seems to have been caused by the changes introduced under bug 5521 caused the problem - reverting that change got this working again ( but reintroduced the 5521 bug)
Comment 3 Colin Campbell 2013-05-20 15:15:34 UTC Comment hidden (obsolete)
Comment 4 Owen Leonard 2013-08-02 12:46:45 UTC
Created attachment 20056 [details]
Screenshot of batch operation after applying the patch

This patch doesn't solve the problem for me. See the attached screenshot. I still don't get the option to make any modifications. The table and its related controls shouldn't be shown at all. All I should see is the message ("Too many items" -- and properly styled in a <div class="dialog message">) and the form for making modifications.
Comment 5 Owen Leonard 2013-08-02 12:47:11 UTC
Also, please provide a proper test plan with any new patch.
Comment 6 Fridolin Somers 2015-12-02 13:55:05 UTC Comment hidden (obsolete)
Comment 7 Fridolin Somers 2015-12-02 13:59:07 UTC
I propose a corrected patch.
Comment 8 Frédéric Demians 2015-12-08 12:54:32 UTC
(In reply to Mason James from comment #0)

> looking that the code its obvious that the intended behavior is to not
> display the items, yet still allow the items to be edited

Fridolin patch restores the above, ie the items are not displayed when there are more than MaxItemsForBatch items, but editing them globally is possible.

The question may be that MaxItemsForBatch syspref states: Process up to MaxItemsForBatch in a single modification or deletion batch. It seems that the wording is not exactly true.
Comment 9 Owen Leonard 2015-12-16 13:46:53 UTC
Created attachment 45723 [details] [review]
[SIGNED-OFF] Bug 10163 - batch-mod items tool fails on files over 1000 lines long

When using batch modification tool, if number of items is too big
(default 1000), the edit form is not displayed.

In perl script, when number of items is too big, template var
"item_loop" is not defined and var "too_many_items"is set.

This patch allows the display of edit form and text "The following
barcodes were found: " even when number of items is too big.

Test plan :
- Create a file with 11 existing barcodes and 1 not existing in
  catalogue
- Set syspref MaxItemsForBatch to 1000
- Go to  Tools > Batch item modification
- Select "Barcode file" and upload file
- Click on continue
  => you see a warning with the not found barcode, a table with found
     items and the edit form
- Set syspref MaxItemsForBatch to 10
- Go to  Tools > Batch item modification
- Select "Barcode file" and upload file
- Click on continue
  => you see a warning with the not found barcode and a text "Too many
     items ..."
  => Without patch you don't see the edit form
  => With patch you see the edit form and can perform the batc
     modifications

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Test plan followed successfully. Item modifications completed correctly.
Comment 10 Jonathan Druart 2015-12-18 11:59:59 UTC
See bug 11343 and bug 11490 for the same discussion.
It would be good to be sure it is what we really want.

In any case, either the pref description or the patch should be updated.
Comment 11 Fridolin Somers 2017-05-15 07:56:02 UTC
Bug 11490 is now integrated, is this bug still valid ?
Comment 12 Katrin Fischer 2023-01-25 22:46:27 UTC
(In reply to Fridolin Somers from comment #11)
> Bug 11490 is now integrated, is this bug still valid ?

I believe this fixed the issue. We now have:

* MaxItemsToDisplayForBatchMod
* MaxItemsToProcessForBatchMod

Marking RESOLVED, please reopen if you disagree!