Bug 29185 - Show MARC21 tag 765 - Original Language Entry
Summary: Show MARC21 tag 765 - Original Language Entry
Status: Needs documenting
Alias: None
Product: Koha
Classification: Unclassified
Component: MARC Bibliographic data support (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Marcel de Rooy
QA Contact: Martin Renvoize
URL:
Keywords: rel_23_05_candidate
Depends on:
Blocks: 33515
  Show dependency treegraph
 
Reported: 2021-10-06 13:54 UTC by Marcel de Rooy
Modified: 2023-05-15 10:44 UTC (History)
6 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:
23.05.00


Attachments
Bug 29185: Facilitate searching for cnum (2.01 KB, patch)
2023-04-13 08:46 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 29185: Groundwork: add template GetCnumSearchURL in Utils (6.84 KB, patch)
2023-04-13 08:46 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 29185: Display MARC tag 765 in OPAC and intranet XSLT (6.82 KB, patch)
2023-04-13 08:46 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 29185: Facilitate searching for cnum (2.01 KB, patch)
2023-04-19 17:39 UTC, David Nind
Details | Diff | Splinter Review
Bug 29185: Groundwork: add template GetCnumSearchURL in Utils (6.85 KB, patch)
2023-04-19 17:39 UTC, David Nind
Details | Diff | Splinter Review
Bug 29185: Display MARC tag 765 in OPAC and intranet XSLT (6.83 KB, patch)
2023-04-19 17:39 UTC, David Nind
Details | Diff | Splinter Review
Bug 29185: Facilitate searching for cnum (2.08 KB, patch)
2023-04-28 07:30 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 29185: Groundwork: add template GetCnumSearchURL in Utils (6.91 KB, patch)
2023-04-28 07:30 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 29185: Display MARC tag 765 in OPAC and intranet XSLT (6.83 KB, patch)
2023-04-28 07:30 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 29185: (QA follow-up) Capitalize AND to ensure it is a boolean for ES (2.45 KB, patch)
2023-04-28 12:15 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 29185: (QA follow-up) Quote title search in GetCnumSearchURL (3.27 KB, patch)
2023-05-10 14:04 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 Marcel de Rooy 2021-10-06 13:54:39 UTC

    
Comment 1 Marcel de Rooy 2023-04-13 08:46:44 UTC
Created attachment 149588 [details] [review]
Bug 29185: Facilitate searching for cnum

Instead of typing the case sensitive Control-number each time.
4 strikes instead of 15 on your keyboard. Wow! Gain of 73%.

Test plan:
Copy ccl.properties to /etc/koha/zebradb, restart Zebra and
search for cnum=SOME_ID in opac or intranet.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Marcel de Rooy 2023-04-13 08:46:46 UTC
Created attachment 149589 [details] [review]
Bug 29185: Groundwork: add template GetCnumSearchURL in Utils

Note for QA: Opened bug 33515 to see if we can use this same
function in a few other places too. Would probably reduce code
and increase consistency.

Test plan:
See next patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 3 Marcel de Rooy 2023-04-13 08:46:49 UTC
Created attachment 149590 [details] [review]
Bug 29185: Display MARC tag 765 in OPAC and intranet XSLT

Test plan:

** For OPAC
[1] Pick a biblio record A as original entry, fill $001/$003.
[2] Pick another biblio record B as translation, add 765 with $t,
    $a and $d. Put (orgcode)cnum from A into $w.
[3] Disable UseControlNumber.
[4] Goto OPAC detail page of B. Check link; should be title based.
[5] Enable UseControlNumber.
[6] Goto OPAC detail page of B. Check link; should incl orgcode and cnum.
[7] Edit B. Replace $w with cnum of A only.
[8] Goto OPAC detail page of B. Check link; should incl cnum only.

** For staff client
[9] Goto staff detail page of B. Check link again.
[10] Edit B. Set 765 ind2 to 8, fill $i.
[11] Goto staff detail page of B. You should see different label.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Marcel de Rooy 2023-04-13 08:49:01 UTC
Katrin: Please take a look at the logic in the second patch building a URL for control-number and corresponding identifier.
Depends on UseControlNumber pref too.
Additionally, it looks at the orgcode if present and narrows the search down to that orgcode too.
Comment 5 David Nind 2023-04-19 17:39:37 UTC
Created attachment 149906 [details] [review]
Bug 29185: Facilitate searching for cnum

Instead of typing the case sensitive Control-number each time.
4 strikes instead of 15 on your keyboard. Wow! Gain of 73%.

Test plan:
Copy ccl.properties to /etc/koha/zebradb, restart Zebra and
search for cnum=SOME_ID in opac or intranet.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Comment 6 David Nind 2023-04-19 17:39:39 UTC
Created attachment 149907 [details] [review]
Bug 29185: Groundwork: add template GetCnumSearchURL in Utils

Note for QA: Opened bug 33515 to see if we can use this same
function in a few other places too. Would probably reduce code
and increase consistency.

Test plan:
See next patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Comment 7 David Nind 2023-04-19 17:39:41 UTC
Created attachment 149908 [details] [review]
Bug 29185: Display MARC tag 765 in OPAC and intranet XSLT

Test plan:

** For OPAC
[1] Pick a biblio record A as original entry, fill $001/$003.
[2] Pick another biblio record B as translation, add 765 with $t,
    $a and $d. Put (orgcode)cnum from A into $w.
[3] Disable UseControlNumber.
[4] Goto OPAC detail page of B. Check link; should be title based.
[5] Enable UseControlNumber.
[6] Goto OPAC detail page of B. Check link; should incl orgcode and cnum.
[7] Edit B. Replace $w with cnum of A only.
[8] Goto OPAC detail page of B. Check link; should incl cnum only.

** For staff client
[9] Goto staff detail page of B. Check link again.
[10] Edit B. Set 765 ind2 to 8, fill $i.
[11] Goto staff detail page of B. You should see different label.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Comment 8 David Nind 2023-04-19 17:48:15 UTC
Testing notes (using KTD):

1. Zebra changes - after applying the patches:
   1.1 cp etc/zebradb/ccl.properties /etc/koha/zebradb/
   1.2 sudo koha-zebra --restart -v kohadev

2. Set up for testing - make these tags and subfields visible in the editor for the BKS MARC framework:
   2.1 003
   2.2 765$a, $d, $i, $t, and $w

3. Records used:
   - Record A: Programming Perl (biblionumber=262)
   - Record B: CGI programming with Perl (biblionumber=11)

4. cnum searching (OPAC and staff interface - should return Programming Perl): cnum=17259930

5. Step 2 of the test plan - 765$w: (OSt)17259930
Comment 9 Marcel de Rooy 2023-04-20 05:33:29 UTC
(In reply to David Nind from comment #7)
> Signed-off-by: David Nind <david@davidnind.com>

Thx David.
Comment 10 Martin Renvoize 2023-04-20 10:40:42 UTC
Just checking with Nick whether we need any index changes for ES to work with this too.. otherwise I'm happy to PQA
Comment 11 Martin Renvoize 2023-04-28 07:26:57 UTC
Nick said: 

"The only bit I am not sure about is the indexing, there is some massaging it looks like in the utils - and I don't see where we have an equivalent in ES"

So, that confirms my suspicions that we might need to do more for this to work with ES
Comment 12 Martin Renvoize 2023-04-28 07:30:04 UTC
Created attachment 150357 [details] [review]
Bug 29185: Facilitate searching for cnum

Instead of typing the case sensitive Control-number each time.
4 strikes instead of 15 on your keyboard. Wow! Gain of 73%.

Test plan:
Copy ccl.properties to /etc/koha/zebradb, restart Zebra and
search for cnum=SOME_ID in opac or intranet.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 13 Martin Renvoize 2023-04-28 07:30:06 UTC
Created attachment 150358 [details] [review]
Bug 29185: Groundwork: add template GetCnumSearchURL in Utils

Note for QA: Opened bug 33515 to see if we can use this same
function in a few other places too. Would probably reduce code
and increase consistency.

Test plan:
See next patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 14 Martin Renvoize 2023-04-28 07:30:09 UTC
Created attachment 150359 [details] [review]
Bug 29185: Display MARC tag 765 in OPAC and intranet XSLT

Test plan:

** For OPAC
[1] Pick a biblio record A as original entry, fill $001/$003.
[2] Pick another biblio record B as translation, add 765 with $t,
    $a and $d. Put (orgcode)cnum from A into $w.
[3] Disable UseControlNumber.
[4] Goto OPAC detail page of B. Check link; should be title based.
[5] Enable UseControlNumber.
[6] Goto OPAC detail page of B. Check link; should incl orgcode and cnum.
[7] Edit B. Replace $w with cnum of A only.
[8] Goto OPAC detail page of B. Check link; should incl cnum only.

** For staff client
[9] Goto staff detail page of B. Check link again.
[10] Edit B. Set 765 ind2 to 8, fill $i.
[11] Goto staff detail page of B. You should see different label.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Comment 15 Martin Renvoize 2023-04-28 07:30:53 UTC
OK, confirms we're only adding an alias here and elasticsearch is handled.

Passing QA
Comment 16 Marcel de Rooy 2023-04-28 07:32:03 UTC
(In reply to Martin Renvoize from comment #11)
> Nick said: 
> 
> "The only bit I am not sure about is the indexing, there is some massaging
> it looks like in the utils - and I don't see where we have an equivalent in
> ES"
> 
> So, that confirms my suspicions that we might need to do more for this to
> work with ES

From IRC:

[09:26] <marcelr> +++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm @@ -82,6 +82,7 @@ our %index_field_convert = (    +    'cnum' => 'control-number',
[09:28] <marcelr> admin/searchengine/elasticsearch/mappings.yaml:  control-number:
[09:28] <marcelr> i am not adding something new, but just an alias
Comment 17 Marcel de Rooy 2023-04-28 07:32:13 UTC
(In reply to Martin Renvoize from comment #15)
> OK, confirms we're only adding an alias here and elasticsearch is handled.
> 
> Passing QA

Thanks
Comment 18 Nick Clemens 2023-04-28 12:15:04 UTC
Created attachment 150365 [details] [review]
Bug 29185: (QA follow-up) Capitalize AND to ensure it is a boolean for ES
Comment 19 Nick Clemens 2023-04-28 12:15:50 UTC
(In reply to Marcel de Rooy from comment #16)
> (In reply to Martin Renvoize from comment #11)
> > Nick said: 
> > 
> > "The only bit I am not sure about is the indexing, there is some massaging
> > it looks like in the utils - and I don't see where we have an equivalent in
> > ES"
> > 
> > So, that confirms my suspicions that we might need to do more for this to
> > work with ES
> 
> From IRC:
> 
> [09:26] <marcelr> +++ b/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm @@
> -82,6 +82,7 @@ our %index_field_convert = (    +    'cnum' =>
> 'control-number',
> [09:28] <marcelr> admin/searchengine/elasticsearch/mappings.yaml: 
> control-number:
> [09:28] <marcelr> i am not adding something new, but just an alias

Ah, I thought I saw some handling in the zebra xslt, but I must have gotten confused. Tested and works nicely with a minor follow-up
Comment 21 Tomás Cohen Arazi 2023-05-09 14:31:46 UTC
Adjust and it will get pushed. No need to be PQA by the freeze.
Comment 22 Marcel de Rooy 2023-05-09 15:01:20 UTC
(In reply to Tomás Cohen Arazi from comment #20)
> I think quoting here is a bit naive... Can we make it use the
> quote_search_terms XSLT template we have:
> 
> https://git.koha-community.org/Koha-community/Koha/src/branch/master/koha-
> tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl#L589
> 
> Example usage:
> https://git.koha-community.org/Koha-community/Koha/src/branch/master/koha-
> tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl#L219-L223

Could you elaborate on this one please?
Which construction do you object to ?

<xsl:value-of select="normalize-space(translate(substring-before(marc:subfield[@code=$cnum_subfield],')'),'()',''))"/>

OR

<xsl:value-of select="str:encode-uri(concat($scriptname,'?q=ti,phr:',translate(marc:subfield[@code=$title_subfield], '()', '')),false())"/>

In both cases it is not just about quoting a URI part.

Note that they are not completely new inventions, but adjusted existent constructs moved to a central template.
Comment 23 Marcel de Rooy 2023-05-09 15:03:13 UTC
<tcohen> you are manually quoting something that comes from the record
[17:02] <tcohen> and could in theory contain quote chars
Comment 24 Marcel de Rooy 2023-05-09 15:03:40 UTC
(In reply to Marcel de Rooy from comment #23)

17:02] <tcohen> the latter
> <tcohen> you are manually quoting something that comes from the record
> [17:02] <tcohen> and could in theory contain quote chars
Comment 25 Marcel de Rooy 2023-05-10 14:04:39 UTC
Created attachment 151009 [details] [review]
Bug 29185: (QA follow-up) Quote title search in GetCnumSearchURL

Test plan:
Disable UseControlNumber
Change biblio title to something like:
    Hamlet or CHINESE_CHARS
where you add some nice Chinese chars.
Create a 765 looking for that title in another biblio record.
Without this patch, the link at detail page finds both records,
since it looks for ti-phr:Hamlet OR the Chinese chars.
With this patch, the link at detail uses quotes and finds only
one, since the OR is now part of the ti-phr search.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 26 Tomás Cohen Arazi 2023-05-10 18:28:32 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 27 Matt Blenkinsop 2023-05-15 10:44:14 UTC
Enhancement - not backporting to 22.11.x