Bug 41301

Summary: Custom fields can not be deleted in ill requests
Product: Koha Reporter: Jan Kissig <bibliothek>
Component: ILLAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: lisette, pedro.amorim, tomascohen
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Jan Kissig 2025-11-25 13:36:52 UTC
When removing custom fields in ill request, they get removed in the UI but remain saved in the database.

1) Enable ILLModule
2) Create an ILL request:
<staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
3) Pick any type, add '42' for cardnumber and any library
4) Edit item metadata (assuming ID 1):
<staff_url>/cgi-bin/koha/ill/ill-requests.pl?op=edititem&illrequest_id=1
5) Click 'Add new field' under 'Custom fields'
6) Add any key value pair but avoid 0 for the value to not run into #41281
7) Click 'Update'. Notice the custom field does show.
8) Edit the item again and remove the created key/value pair.
9) Update the request and you will find the key/value pair still remaining
Comment 1 Jan Kissig 2025-11-28 07:17:59 UTC
The code where this should be handled seems to be not implemented at all 

https://gitlab.com/koha-community/Koha/-/blob/main/Koha/ILL/Backend/Standard.pm?ref_type=heads#L412

There are checks for add_new_custom and custom_delete form values which are never set in the UI.