Bug 36628

Summary: Error 500 when loading pending orders table for receiving on parcel.pl
Product: Koha Reporter: Emily Lamancusa (emlam) <emily.lamancusa>
Component: Architecture, internals, and plumbingAssignee: Bugs List <koha-bugs>
Status: RESOLVED INVALID QA Contact: Testopia <testopia>
Severity: critical    
Priority: P5 - low CC: m.de.rooy
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on:    
Bug Blocks: 36192    

Description Emily Lamancusa (emlam) 2024-04-17 16:49:43 UTC
To reproduce:
1. Have at least one closed basket with an order line
   (When I reproduced it, I created an order from a new biblio record in KTD's sample basket, then closed the basket)
2. Go to Receive Shipments and add an invoice
3. Proceed to the next step of selecting order(s) to receive
-->A pop-up appear with the error, "Something went wrong when loading the table. 500: Internal Server Error", and the Pending Orders table fails to load and is empty.

I'm guessing something involving the REST API call needs to be updated for CSRF? I did confirm the table loads normally on the commit before the CSRF updates were pushed.
Comment 1 Marcel de Rooy 2024-04-18 10:01:25 UTC
Hi Emily,
I tried to reproduce on current master in my dev env but couldnt.
Could you check your logs and provide more details on this crash?
Comment 2 Emily Lamancusa (emlam) 2024-04-18 15:46:02 UTC
I can't reproduce now either. Must have been something in my dev environment. Sorry about that!
Comment 3 Katrin Fischer 2024-04-18 21:05:37 UTC
Next time you see this: checked if your order line is linked to an item without item type - we have seen it a lot in that context.
Comment 4 Marcel de Rooy 2024-04-19 07:49:43 UTC
(In reply to Emily Lamancusa from comment #2)
> I can't reproduce now either. Must have been something in my dev
> environment. Sorry about that!

(In reply to Katrin Fischer from comment #3)
> Next time you see this: checked if your order line is linked to an item
> without item type - we have seen it a lot in that context.

We found the culprit on 36018. Not trivial: a ambiguous quantity column when the REST API adds a related table based on an embed.