Bug 22058 - OPAC holdings table shows   instead of blank
Summary: OPAC holdings table shows   instead of blank
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Katrin Fischer
QA Contact: Tomás Cohen Arazi
URL:
Keywords:
Depends on: 13618
Blocks:
  Show dependency treegraph
 
Reported: 2019-01-02 11:19 UTC by Mark Alexander
Modified: 2019-02-25 07:03 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
OPAC MARC view holding detail in 18.11 (20.80 KB, image/png)
2019-01-02 11:19 UTC, Mark Alexander
Details
Bug 22058: Fix display of empty table cells in OPAC MARC view holdings (1.67 KB, patch)
2019-01-02 23:19 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 22058: Fix display of empty table cells in OPAC MARC view holdings (1.71 KB, patch)
2019-01-03 15:44 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 22058: Fix display of empty table cells in OPAC MARC view holdings (1.77 KB, patch)
2019-01-09 10:39 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Alexander 2019-01-02 11:19:27 UTC
Created attachment 83573 [details]
OPAC MARC view holding detail in 18.11

In the OPAC, when looking at the MARC view for an item, there is a
table at the bottom of the page showing some holding information.
Those table fields that used to be blank in 18.05 are now displaying
as " " (without the quotes) in 18.11.  In my particular case, the
fields that are displayed this way are:

* Withdrawn status
* Lost status
* Damaged status
* Not for loan
Comment 1 Katrin Fischer 2019-01-02 22:44:47 UTC
Maybe a similar fix as bug 21279?
Comment 2 Katrin Fischer 2019-01-02 23:13:38 UTC
It's line 320 in opac-MARCDetail.pl:
        $item_data->{$subfield_code} ||= " "

If you change that to " " or "" it will display correctly.

But: I compared the display to staff and there we actually use a $raw filter on the template which will also display correctly. It has the added benefit that HTML used in note fields (I know, we do that) will display correctly.

So I will propose a patch making staff and OPAC match.
Comment 3 Katrin Fischer 2019-01-02 23:19:25 UTC
Created attachment 83609 [details] [review]
Bug 22058: Fix display of empty table cells in OPAC MARC view holdings

I compared the template logic to the MARC detail page in staff.
We use $raw there instead of html, which will also make notes and other
fields with HTML in them display correctly. I am proposing to use the
$raw filter in OPAC as well.

To test:
- Go to the OPAC
- Search for a record with items
- Switch to the MARC view
- Verify empty cells show   (html entity for space)
- Apply patch
- Repeat test
- Verify empty table cells now show as empty
Comment 4 Owen Leonard 2019-01-03 15:44:54 UTC
Created attachment 83621 [details] [review]
Bug 22058: Fix display of empty table cells in OPAC MARC view holdings

I compared the template logic to the MARC detail page in staff.
We use $raw there instead of html, which will also make notes and other
fields with HTML in them display correctly. I am proposing to use the
$raw filter in OPAC as well.

To test:
- Go to the OPAC
- Search for a record with items
- Switch to the MARC view
- Verify empty cells show   (html entity for space)
- Apply patch
- Repeat test
- Verify empty table cells now show as empty

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 5 Tomás Cohen Arazi 2019-01-07 10:07:29 UTC
This one probably deserves a t/db_dependent/selenium/regressions.t test. Specially if we allow HTML in note fields.
Comment 6 Tomás Cohen Arazi 2019-01-09 10:39:44 UTC
Created attachment 83736 [details] [review]
Bug 22058: Fix display of empty table cells in OPAC MARC view holdings

I compared the template logic to the MARC detail page in staff.
We use $raw there instead of html, which will also make notes and other
fields with HTML in them display correctly. I am proposing to use the
$raw filter in OPAC as well.

To test:
- Go to the OPAC
- Search for a record with items
- Switch to the MARC view
- Verify empty cells show &nbsp; (html entity for space)
- Apply patch
- Repeat test
- Verify empty table cells now show as empty

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 7 Nick Clemens 2019-01-18 20:59:22 UTC
Awesome work all!

Pushed to master for 19.05
Comment 8 Martin Renvoize 2019-01-23 12:43:07 UTC
Pushed to 18.11.x for 18.11.03
Comment 9 Jesse Maseto 2019-01-23 19:12:27 UTC
Merge conflicts with 18.05. Will not be backported.
Comment 10 Fridolin SOMERS 2019-02-25 07:03:34 UTC
(In reply to Jesse Maseto from comment #9)
> Merge conflicts with 18.05. Will not be backported.

This patch is not needed for 18.05.x since the var is not escaped :
[% item.$sf_code %]