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>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Pedro Amorim 2025-11-21 15:49:16 +00:00 committed by Lucas Gass
parent 5262ff688b
commit 62db27bc7c
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 5 additions and 6 deletions

View File

@ -750,12 +750,11 @@
<div class="rows">
<h4>Details from supplier ([% request.backend | html %])</h4>
<ol>
[% FOREACH meta IN request.metadata.keys.sort('lower') %]
[% val = request.metadata.${meta} %]
[% IF val %]
<li class="requestmeta-[% meta.replace('\s','_') | html %]">
<span class="label">[% meta.replace('_',' ') | html %]:</span>
[% val | html %]
[% FOREACH meta IN request.metadata %]
[% IF meta.value.defined && meta.value.length %]
<li class="requestmeta-[% meta.key.replace('\s','_') | html %]">
<span class="label">[% meta.key.replace('_',' ') | html %]:</span>
[% meta.value | html %]
</li>
[% END %]
[% END %]