Bug 41884

Summary: Job report for batch item modifications that fail due to PreventWithdrawingItemsStatus has no details on failed items
Product: Koha Reporter: Sara Brown <sbrown>
Component: ToolsAssignee: Lucas Gass (lukeg) <lucas>
Status: Signed Off --- QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: david, lucas
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23010
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38368
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 41884: Add better reporting when item fails to modify via batch mod
Bug 41884: Add better reporting when item fails to modify via batch mod

Description Sara Brown 2026-02-18 18:54:57 UTC
If PreventWithdrawingItemsStatus is set to prevent withdrawal of in transit and/or checked out items, and some items in a batch item modification fail because they're either in transit or checked out, the job details screen does not provide any information about which items failed or the reason for the failure. 

At a minimum, it should show the item number or barcode so that libraries know which items need attention. When individual items can't be withdrawn due to the system preference, the error message notes the reason, so ideally that would be included in the job report too.
Comment 1 Lucas Gass (lukeg) 2026-02-18 21:55:57 UTC
Created attachment 193367 [details] [review]
Bug 41884: Add better reporting when item fails to modify via batch mod

To test:
1. Search for the system preference, PreventWithDrawingItemsStatus
2. Select both in transit and checked out, then save
3. Find an item and put it in transit.
4. Try to batch modify the item, making it withdrawen.
5. View the details of job, you should see 1 item could not be modified.
6. APPLY PATCH, restart_all
7. Try the steps again, this time when you get to the details of the job you should see more information on the item that failed:

    1 item could not be modified.
        39999000001457 : Item is in transit

8. Repeat this steps with a a checkout out item.
9. Also try with multiple items that will fail, ensure the display looks good.
Comment 2 David Nind 2026-02-21 03:41:07 UTC
Created attachment 193596 [details] [review]
Bug 41884: Add better reporting when item fails to modify via batch mod

To test:
1. Search for the system preference, PreventWithDrawingItemsStatus
2. Select both in transit and checked out, then save
3. Find an item and put it in transit.
4. Try to batch modify the item, making it withdrawen.
5. View the details of job, you should see 1 item could not be modified.
6. APPLY PATCH, restart_all
7. Try the steps again, this time when you get to the details of the job you should see more information on the item that failed:

    1 item could not be modified.
        39999000001457 : Item is in transit

8. Repeat this steps with a a checkout out item.
9. Also try with multiple items that will fail, ensure the display looks good.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2026-02-21 03:46:51 UTC
I think it would be better not to have a space before the colon, but I couldn't work out how to do that:
- instead of 39999000005097 : Item is in transit
- show as 39999000005097: Item is in transit

I wasn't quite sure what was meant in steps 8 and 9 - I did a batch modification to make the items withdrawn, where multiple items were in transit and one item was already checked out.