Bug 39078 - Incorrect variable checks in course reserve details template
Summary: Incorrect variable checks in course reserve details template
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Course reserves (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Owen Leonard
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-10 16:34 UTC by Owen Leonard
Modified: 2025-02-21 15:45 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 39078: Fix incorrect variable checks in course reserve details template (6.11 KB, patch)
2025-02-10 17:21 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 39078: Fix incorrect variable checks in course reserve details template (5.77 KB, patch)
2025-02-12 16:45 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 39078: Fix incorrect variable checks in course reserve details template (5.82 KB, patch)
2025-02-18 18:23 UTC, David Nind
Details | Diff | Splinter Review
Bug 39078: Fix incorrect variable checks in course reserve details template (5.91 KB, patch)
2025-02-21 09:11 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2025-02-10 16:34:46 UTC
There are some bad--and missing--template variable checks in the course details template which result in empty parentheses showing up in the table of items in the course.
Comment 1 Owen Leonard 2025-02-10 17:21:46 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2025-02-12 16:45:30 UTC
Created attachment 177946 [details] [review]
Bug 39078: Fix incorrect variable checks in course reserve details template

This patch adds some variable checks and corrects some others so that
the course reserve detail template doesn't show empty parentheses.

To test, apply the patch and create a course if necessary.

- Add an item to the course.
- After submitting a barcode, check the checkbox next to each option and
  select a different value (item type, collection, etc.).
- View the course details and check the columns for the fields you
  changed. They should display the correct information:
  "Updated field value (Original field value)"
- Add another item but this time don't change any options. The
  information should be display as:
  "Unchanged (Original field value)"
- There should be no instances where it looks like:
  "Field value ()"

Sponsored-by: Athens County Public Libraries
Comment 3 David Nind 2025-02-18 18:23:27 UTC
Created attachment 178301 [details] [review]
Bug 39078: Fix incorrect variable checks in course reserve details template

This patch adds some variable checks and corrects some others so that
the course reserve detail template doesn't show empty parentheses.

To test, apply the patch and create a course if necessary.

- Add an item to the course.
- After submitting a barcode, check the checkbox next to each option and
  select a different value (item type, collection, etc.).
- View the course details and check the columns for the fields you
  changed. They should display the correct information:
  "Updated field value (Original field value)"
- Add another item but this time don't change any options. The
  information should be display as:
  "Unchanged (Original field value)"
- There should be no instances where it looks like:
  "Field value ()"

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2025-02-18 18:24:48 UTC
Testing notes (using KTD):

1. I couldn't replicate the issue with empty brackets by adding a course reserve and not selecting any fields (or making changes).
Comment 5 Marcel de Rooy 2025-02-21 09:11:48 UTC
Created attachment 178451 [details] [review]
Bug 39078: Fix incorrect variable checks in course reserve details template

This patch adds some variable checks and corrects some others so that
the course reserve detail template doesn't show empty parentheses.

To test, apply the patch and create a course if necessary.

- Add an item to the course.
- After submitting a barcode, check the checkbox next to each option and
  select a different value (item type, collection, etc.).
- View the course details and check the columns for the fields you
  changed. They should display the correct information:
  "Updated field value (Original field value)"
- Add another item but this time don't change any options. The
  information should be display as:
  "Unchanged (Original field value)"
- There should be no instances where it looks like:
  "Field value ()"

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 6 Katrin Fischer 2025-02-21 15:45:01 UTC
Pushed for 25.05!

Well done everyone, thank you!