Bug 41281

Summary: ILL request metadata doesn't show if falsy
Product: Koha Reporter: Pedro Amorim <pedro.amorim>
Component: ILLAssignee: Pedro Amorim <pedro.amorim>
Status: Signed Off --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: bibliothek, lisette, pedro.amorim, richard.bridgen, tomascohen
Version: Main   
Hardware: All   
OS: All   
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 41281: Only skip metadata if empty or undefined
Bug 41281: Only skip metadata if empty or undefined

Description Pedro Amorim 2025-11-21 15:48:49 UTC
If an illrequestattribute happens to have the intentional value of '0' it is not shown.
Comment 1 Pedro Amorim 2025-11-21 15:53:15 UTC
Created attachment 189861 [details] [review]
Bug 41281: Only skip metadata if empty or undefined

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 value for 'key' e.g. "test" and '0' for value.
7) Click 'Update'. Notice the custom field doesn't show.
8) Apply patch. Refresh. Verify it shows now.
Comment 2 Pedro Amorim 2025-11-24 16:16:38 UTC
Created attachment 189917 [details] [review]
Bug 41281: Only skip metadata if empty or undefined

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 value for 'key' e.g. "test" and '0' for value.
7) Click 'Update'. Notice the custom field doesn't show.
8) Apply patch. Refresh. Verify it shows now.

Signed-off-by: Richard Bridgen <richard.bridgen@nhs.net>
Comment 3 Jan Kissig 2025-11-25 13:27:48 UTC
As meta.value gets only printed, and therefore is not evaluated, the whole check could also be omitted.