https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44181 --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 212178 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212178&action=edit Bug 44181: Allow null patron, library and status in ILL batch API illbatches.patron_id, library_id and status_code are set to NULL when the linked patron, library or status is deleted. The API spec did not allow null, so listing batches returned a 500 and the batches page never loaded. Test plan: 1) Enable 'ILLModule' 2) Create a patron: go to Patrons > 'New patron' > 'Patron', set surname 'Orphan', card number 'orphan1', library 'Centerville', and save. Note the borrowernumber from the URL 3) Create a library: go to Administration > Libraries > 'New library', set code 'ORPH', name 'Orphan library', and save 4) Create two batches: echo "INSERT INTO illbatches (name, backend, patron_id, library_id, status_code) VALUES ('Orphan patron batch', 'Standard', <borrowernumber>, 'CPL', 'NEW'), ('Orphan library batch', 'Standard', 51, 'ORPH', 'NEW')" | koha-mysql kohadev 5) Go to the batches list (http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?method=batch_list) 6) Confirm both batches show 7) Delete patron 'Orphan' (patron details page > 'More' > 'Delete') 8) Delete library 'ORPH' (Administration > Libraries > 'Actions' > 'Delete') 9) Before applying the patch, refresh the batches list 10) Confirm the table never loads (browser console shows a 500 for /api/v1/ill/batches) 11) Apply the patch, run yarn api:bundle and restart plack (koha-plack --restart kohadev), refresh (Ctrl+Shift+R) 12) Confirm the table loads and shows both batches: - 'Orphan patron batch' has an empty 'Patron' column - 'Orphan library batch' has an empty 'Library' column 13) Run the tests: prove t/db_dependent/api/v1/ill_batches.t Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.