Bug 26862

Summary: MARC21 530 is missing from staff interface and has no label
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: MARC Bibliographic data supportAssignee: Katrin Fischer <katrin.fischer>
Status: RESOLVED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: minor    
Priority: P5 - low CC: david, flyingendpaper, m.de.rooy, martin.renvoize
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This fixes the display of the MARC21 530 tag and subfields so that it: - now displays in the staff interface (was missing) - improves the display of the values by adding . a description/label . separators between repeated 530 tags . missing spaces before $u and between repeated $u subfields
Version(s) released in:
23.11.00,23.05.02,22.11.08
Circulation function:
Attachments: Bug 26862: Improve MARC21 530 display on detail pages
Bug 26862: Improve MARC21 530 display on detail pages
Bug 26862: Improve MARC21 530 display on detail pages
Bug 26862: Improve MARC21 530 display on detail pages
Bug 26862: Improve MARC21 530 display on detail pages

Description Katrin Fischer 2020-10-29 14:24:15 UTC
In the XSLT 530 is missing a label with the description of the field.

To test:
- Catalog a 530 in any record
- Verify the display in the OPAC and staff is missing the label and the content appears in a different size than the rest of the entries from the bibliographic record

http://www.loc.gov/marc/bibliographic/bd530.html
Comment 1 Katrin Fischer 2023-07-03 16:57:43 UTC
Created attachment 152989 [details] [review]
Bug 26862: Improve MARC21 530 display on detail pages

This makes some changes to the way we display field 530 in OPAC
and staff interface:

* Adds missing spaces before $u and between repeated $u subfields
* Adds a description/label before the output of the subfields
* Adds display to the staff interface (was OPAC only)
* Adds separators between repeated 530 fields:
  * OPAC: updates mark-up to use the new CSS driven separators
  * Staff interface: adds | with separator class

To test:
* Find or create a records with multiple 530 entries
* Repeat $u with multiple URLs
* Verify display in staff (missing) and OPAC
* Apply patch
* Verify display is improved :D
Comment 2 Katrin Fischer 2023-07-03 17:13:06 UTC
Created attachment 152990 [details] [review]
Bug 26862: Improve MARC21 530 display on detail pages

This makes some changes to the way we display field 530 in OPAC
and staff interface:

* Adds missing spaces before $u and between repeated $u subfields
* Adds a description/label before the output of the subfields
* Adds display to the staff interface (was OPAC only)
* Adds separators between repeated 530 fields:
  * OPAC: updates mark-up to use the new CSS driven separators
  * Staff interface: adds | with separator class

To test:
* Find or create a records with multiple 530 entries
* Repeat $u with multiple URLs
* Verify display in staff (missing) and OPAC
* Apply patch
* Verify display is improved :D
Comment 3 David Nind 2023-07-03 20:20:32 UTC
Created attachment 152993 [details] [review]
Bug 26862: Improve MARC21 530 display on detail pages

This makes some changes to the way we display field 530 in OPAC
and staff interface:

* Adds missing spaces before $u and between repeated $u subfields
* Adds a description/label before the output of the subfields
* Adds display to the staff interface (was OPAC only)
* Adds separators between repeated 530 fields:
  * OPAC: updates mark-up to use the new CSS driven separators
  * Staff interface: adds | with separator class

To test:
* Find or create a records with multiple 530 entries
* Repeat $u with multiple URLs
* Verify display in staff (missing) and OPAC
* Apply patch
* Verify display is improved :D

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2023-07-03 20:28:42 UTC
Testing notes (using KTD):

1. Change the BKS framework so that 530 can be edited in the staff interface.
Comment 5 ByWater Sandboxes 2023-07-05 20:13:06 UTC
Created attachment 153077 [details] [review]
Bug 26862: Improve MARC21 530 display on detail pages

This makes some changes to the way we display field 530 in OPAC
and staff interface:

* Adds missing spaces before $u and between repeated $u subfields
* Adds a description/label before the output of the subfields
* Adds display to the staff interface (was OPAC only)
* Adds separators between repeated 530 fields:
  * OPAC: updates mark-up to use the new CSS driven separators
  * Staff interface: adds | with separator class

To test:
* Find or create a records with multiple 530 entries
* Repeat $u with multiple URLs
* Verify display in staff (missing) and OPAC
* Apply patch
* Verify display is improved :D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov>
Comment 6 Katrin Fischer 2023-07-05 20:58:39 UTC
Thank you, David and Heather!
Heather, if I work on other XSLT patches, would you like me to CC you?
Comment 7 Heather 2023-07-05 21:12:25 UTC
Sure, Katrin!  Yes, please do!  I felt that this was a bug I could really test.:)

Happy to help!
--h2
Comment 8 Marcel de Rooy 2023-07-07 07:16:05 UTC
<xsl:attribute name="href"><xsl:value-of select="text()"/></xsl:attribute>
You might need to str-encode-uri and normalize-space stuff here.
Something like (do not copy):
<xsl:value-of select="str:encode-uri(concat($scriptname,'?q=ti,phr:',translate($quoted_title, '()', '')),false())"/>
<xsl:value-of select="normalize-space(marc:subfield[@code=$cnum_subfield])"/>

Why do you open a new window in OPAC (pref dependent) and not in staff? Could imagine that staff could have it.
Comment 9 Marcel de Rooy 2023-07-07 07:24:22 UTC
(In reply to Marcel de Rooy from comment #8)
> <xsl:attribute name="href"><xsl:value-of select="text()"/></xsl:attribute>
> You might need to str-encode-uri and normalize-space stuff here.
> Something like (do not copy):
> <xsl:value-of
> select="str:encode-uri(concat($scriptname,'?q=ti,phr:',
> translate($quoted_title, '()', '')),false())"/>
> <xsl:value-of select="normalize-space(marc:subfield[@code=$cnum_subfield])"/>

You might ignore this remark looking at e.g. 856u
Comment 10 Katrin Fischer 2023-07-08 13:31:03 UTC
> You might ignore this remark looking at e.g. 856(In reply to Marcel de Rooy from comment #8)
> <xsl:attribute name="href"><xsl:value-of select="text()"/></xsl:attribute>
> You might need to str-encode-uri and normalize-space stuff here.
> Something like (do not copy):
> <xsl:value-of
> select="str:encode-uri(concat($scriptname,'?q=ti,phr:',
> translate($quoted_title, '()', '')),false())"/>
> <xsl:value-of select="normalize-space(marc:subfield[@code=$cnum_subfield])"/>

This part pre-dates my patch, I can have a look at 856.

> Why do you open a new window in OPAC (pref dependent) and not in staff?
> Could imagine that staff could have it.

Because we don't have an equivalent of the pref for the staff interface and we don't use the OPAC one in staff either. I stumbled on that too when working on the patch, should maybe have left a note :)
Comment 11 Katrin Fischer 2023-07-10 10:50:56 UTC
(In reply to Katrin Fischer from comment #10)
> > You might ignore this remark looking at e.g. 856(In reply to Marcel de Rooy from comment #8)
> > <xsl:attribute name="href"><xsl:value-of select="text()"/></xsl:attribute>
> > You might need to str-encode-uri and normalize-space stuff here.
> > Something like (do not copy):
> > <xsl:value-of
> > select="str:encode-uri(concat($scriptname,'?q=ti,phr:',
> > translate($quoted_title, '()', '')),false())"/>
> > <xsl:value-of select="normalize-space(marc:subfield[@code=$cnum_subfield])"/>
> 
> This part pre-dates my patch, I can have a look at 856.

I had a look, but I am not sure this applies here. $u is a full URL here, not a parameter we use to build a search URL, so there should not be a need to encode it - it might even break things if it's already encoded. Do you agree?

> > Why do you open a new window in OPAC (pref dependent) and not in staff?
> > Could imagine that staff could have it.
> 
> Because we don't have an equivalent of the pref for the staff interface and
> we don't use the OPAC one in staff either. I stumbled on that too when
> working on the patch, should maybe have left a note :)

See:
Bug 29739 - Add a staff counterpart for OPACURLOpenInNewWindow

Currently we only open the "OPAC" link and the links to authorities in a new tab, so behavior is consistent with this patch, even if it could be improved.
Comment 12 Marcel de Rooy 2023-07-11 11:13:17 UTC
Created attachment 153311 [details] [review]
Bug 26862: Improve MARC21 530 display on detail pages

This makes some changes to the way we display field 530 in OPAC
and staff interface:

* Adds missing spaces before $u and between repeated $u subfields
* Adds a description/label before the output of the subfields
* Adds display to the staff interface (was OPAC only)
* Adds separators between repeated 530 fields:
  * OPAC: updates mark-up to use the new CSS driven separators
  * Staff interface: adds | with separator class

To test:
* Find or create a records with multiple 530 entries
* Repeat $u with multiple URLs
* Verify display in staff (missing) and OPAC
* Apply patch
* Verify display is improved :D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 13 Marcel de Rooy 2023-07-11 11:16:50 UTC
Passing QA.

What I miss (not only here, but in general) is additional validation of what we entered in $u or similar fields. Learned by experience that there may be trailing spaces in such fields breaking URLs, and so on.

And on the subject of new windows, I would rather open a new window by default than replace the current one just as we do now. But that may be a personal pref. We should indeed create the staff counterpart of the OPAC pref.

So no blockers left here.
Comment 14 Tomás Cohen Arazi (tcohen) 2023-07-11 11:52:02 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 15 Martin Renvoize (ashimema) 2023-07-18 10:08:10 UTC
Thanks for all the hard work!

Pushed to 23.05.x for the next release
Comment 16 Matt Blenkinsop 2023-07-18 14:14:56 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x