Bug 41301 - Custom fields can not be deleted in ill requests
Summary: Custom fields can not be deleted in ill requests
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: ILL (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-25 13:36 UTC by Jan Kissig
Modified: 2025-11-28 07:17 UTC (History)
3 users (show)

See Also:
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:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.