Bug 30678 - Add OCLC_NO as option to OPACSearchForTitleIn
Summary: Add OCLC_NO as option to OPACSearchForTitleIn
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Marcel de Rooy
QA Contact: Kyle M Hall
URL:
Keywords:
Depends on:
Blocks: 35142
  Show dependency treegraph
 
Reported: 2022-05-04 14:22 UTC by Marcel de Rooy
Modified: 2023-10-24 12:38 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact: Caroline Cyr La Rose
Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/678
Text to go in the release notes:
This enhancement to the OPAC detail page allows you to search WorldCat using the OCLC number. (Example: add an entry to 035$a (such as (OCoLC)62385712) and use {OCLC_NO} in the OPACSearchForTitleIn system preference.)
Version(s) released in:
22.11.00


Attachments
Bug 30678: Add OCLC_NO as option to OPACSearchForTitleIn (3.57 KB, patch)
2022-05-04 14:39 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 30678: Adjust pref description (1.46 KB, patch)
2022-05-04 14:39 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 30678: (follow-up) Add oclc_number routine and friends (5.19 KB, patch)
2022-05-10 14:11 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 30678: (follow-up) Change call in opac scripts (2.92 KB, patch)
2022-05-10 14:11 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 30678: Add OCLC_NO as option to OPACSearchForTitleIn (3.58 KB, patch)
2022-05-11 00:50 UTC, David Nind
Details | Diff | Splinter Review
Bug 30678: Adjust pref description (1.47 KB, patch)
2022-05-11 00:50 UTC, David Nind
Details | Diff | Splinter Review
Bug 30678: (follow-up) Add oclc_number routine and friends (5.20 KB, patch)
2022-05-11 00:50 UTC, David Nind
Details | Diff | Splinter Review
Bug 30678: (follow-up) Change call in opac scripts (2.93 KB, patch)
2022-05-11 00:50 UTC, David Nind
Details | Diff | Splinter Review
Bug 30678: Add OCLC_NO as option to OPACSearchForTitleIn (3.62 KB, patch)
2022-06-17 07:08 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 30678: Adjust pref description (1.51 KB, patch)
2022-06-17 07:08 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 30678: (follow-up) Add oclc_number routine and friends (5.24 KB, patch)
2022-06-17 07:08 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 30678: (follow-up) Change call in opac scripts (2.98 KB, patch)
2022-06-17 07:08 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 30678: Add OCLC_NO as option to OPACSearchForTitleIn (3.64 KB, patch)
2022-07-22 16:23 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 30678: Add OCLC_NO as option to OPACSearchForTitleIn (3.64 KB, patch)
2022-07-22 16:28 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 30678: Adjust pref description (1.53 KB, patch)
2022-07-22 16:28 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 30678: (follow-up) Add oclc_number routine and friends (5.26 KB, patch)
2022-07-22 16:28 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 30678: (follow-up) Change call in opac scripts (3.00 KB, patch)
2022-07-22 16:28 UTC, Kyle M Hall
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 2022-05-04 14:22:41 UTC
This only does very basic adjustments:
Allow to replace OCLC_NO by MARC21 035$a.
Remove the (orgcode) prefix.

Will open another bug to make C4::Output::parametrized_url a bit smarter.
Comment 1 Marcel de Rooy 2022-05-04 14:39:44 UTC
Created attachment 134613 [details] [review]
Bug 30678: Add OCLC_NO as option to OPACSearchForTitleIn

We need to pass OCLC_NO as key to C4::Output::parametrized_url.
We get it from MARC21 035$a and strip the organizational code.

Test plan:
Add e.g. 62385712 in 035$a in a record.
Add e.g. following link to pref OPACSearchForTitleIn:
    <a  href="https://worldcat.org/search?q={OCLC_NO}" target="_blank">WorldCat (via OCLC number)</a>
Open that record on detail page. Click More searches. Follow that link.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Marcel de Rooy 2022-05-04 14:39:48 UTC
Created attachment 134614 [details] [review]
Bug 30678: Adjust pref description

Test plan:
Look up pref OPACSearchForTitleIn.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 3 Katrin Fischer 2022-05-04 17:19:43 UTC
I don't think the name is a good fit, because 035$a is repeatable and not reserved for WorldCat numbers. It all depends on the prefix.

I think if you want to keep the name, you should use the prefixes (I think there are multiple) to select the actual OCLC number. 

But I'd like it even better, if we could make the prefix configurable, maybe as an attribute or with a pipe in the placeholder? This would also help to deal with cases of multiple 035$a and make it useful for even more use cases.

To give an example from one of our union catalog records:

035 _a(DE-627)1618146513
035 _a(DE-576)303474114
035 _a(DE-599)BSZ303474114
035 _a(OCoLC)611542131 

2 are union catalog internal identifiers, one is German national library and one is WorldCat.

It's also not clear which would be picked if there are multiple (first?)
Comment 4 Marcel de Rooy 2022-05-10 14:11:44 UTC
Created attachment 134814 [details] [review]
Bug 30678: (follow-up) Add oclc_number routine and friends

As requested by QA, we should match the orgcode.
Adding a few small routines in a Util module.

Test plan:
Run t/Koha/Util/MARC.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Marcel de Rooy 2022-05-10 14:11:48 UTC
Created attachment 134815 [details] [review]
Bug 30678: (follow-up) Change call in opac scripts

Test plan:
See first patch. Add orgcode OCoLC.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 6 Marcel de Rooy 2022-05-10 14:15:12 UTC
(In reply to Katrin Fischer from comment #3)
> I don't think the name is a good fit, because 035$a is repeatable and not
> reserved for WorldCat numbers. It all depends on the prefix.

Good point.

> I think if you want to keep the name, you should use the prefixes (I think
> there are multiple) to select the actual OCLC number. 

The regex now covers all important ones: OCoLC with/without suffixes.

> But I'd like it even better, if we could make the prefix configurable, maybe
> as an attribute or with a pipe in the placeholder? This would also help to
> deal with cases of multiple 035$a and make it useful for even more use cases.

This requires more work. Part of it is reworking parametrized_url. Postponing this here to bug 30679.

> It's also not clear which would be picked if there are multiple (first?)

Currently the first one. But here also, 30679 could make improvements.
Comment 7 David Nind 2022-05-11 00:50:42 UTC
Created attachment 134844 [details] [review]
Bug 30678: Add OCLC_NO as option to OPACSearchForTitleIn

We need to pass OCLC_NO as key to C4::Output::parametrized_url.
We get it from MARC21 035$a and strip the organizational code.

Test plan:
Add e.g. 62385712 in 035$a in a record.
Add e.g. following link to pref OPACSearchForTitleIn:
    <a  href="https://worldcat.org/search?q={OCLC_NO}" target="_blank">WorldCat (via OCLC number)</a>
Open that record on detail page. Click More searches. Follow that link.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: David Nind <david@davidnind.com>
Comment 8 David Nind 2022-05-11 00:50:47 UTC
Created attachment 134845 [details] [review]
Bug 30678: Adjust pref description

Test plan:
Look up pref OPACSearchForTitleIn.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: David Nind <david@davidnind.com>
Comment 9 David Nind 2022-05-11 00:50:52 UTC
Created attachment 134846 [details] [review]
Bug 30678: (follow-up) Add oclc_number routine and friends

As requested by QA, we should match the orgcode.
Adding a few small routines in a Util module.

Test plan:
Run t/Koha/Util/MARC.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: David Nind <david@davidnind.com>
Comment 10 David Nind 2022-05-11 00:50:56 UTC
Created attachment 134847 [details] [review]
Bug 30678: (follow-up) Change call in opac scripts

Test plan:
See first patch. Add orgcode OCoLC.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: David Nind <david@davidnind.com>
Comment 11 David Nind 2022-05-11 00:52:11 UTC
Tetsing notes (koha-testing-docker):

1. Make tag 035 and subfields visible in the MARC editor for the BKS framework.

2. Add entry to 035$a = (OCoLC)62385712

3. Follow the rest of the test plan.
Comment 12 Marcel de Rooy 2022-05-11 11:09:17 UTC
(In reply to David Nind from comment #10)
> Signed-off-by: David Nind <david@davidnind.com>

Thx David !
Comment 13 Marcel de Rooy 2022-06-17 07:07:30 UTC
Patch does not apply, Kyle ??

Applying: Bug 30678: Add OCLC_NO as option to OPACSearchForTitleIn
Applying: Bug 30678: Adjust pref description
Applying: Bug 30678: (follow-up) Add oclc_number routine and friends
Applying: Bug 30678: (follow-up) Change call in opac scripts
Using index info to reconstruct a base tree...
M       opac/opac-ISBDdetail.pl
M       opac/opac-MARCdetail.pl
M       opac/opac-detail.pl
Falling back to patching base and 3-way merge...
Auto-merging opac/opac-detail.pl
Auto-merging opac/opac-MARCdetail.pl
Auto-merging opac/opac-ISBDdetail.pl
Comment 14 Marcel de Rooy 2022-06-17 07:08:33 UTC
Created attachment 136222 [details] [review]
Bug 30678: Add OCLC_NO as option to OPACSearchForTitleIn

We need to pass OCLC_NO as key to C4::Output::parametrized_url.
We get it from MARC21 035$a and strip the organizational code.

Test plan:
Add e.g. 62385712 in 035$a in a record.
Add e.g. following link to pref OPACSearchForTitleIn:
    <a  href="https://worldcat.org/search?q={OCLC_NO}" target="_blank">WorldCat (via OCLC number)</a>
Open that record on detail page. Click More searches. Follow that link.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: David Nind <david@davidnind.com>
Comment 15 Marcel de Rooy 2022-06-17 07:08:37 UTC
Created attachment 136223 [details] [review]
Bug 30678: Adjust pref description

Test plan:
Look up pref OPACSearchForTitleIn.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: David Nind <david@davidnind.com>
Comment 16 Marcel de Rooy 2022-06-17 07:08:40 UTC
Created attachment 136224 [details] [review]
Bug 30678: (follow-up) Add oclc_number routine and friends

As requested by QA, we should match the orgcode.
Adding a few small routines in a Util module.

Test plan:
Run t/Koha/Util/MARC.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: David Nind <david@davidnind.com>
Comment 17 Marcel de Rooy 2022-06-17 07:08:44 UTC
Created attachment 136225 [details] [review]
Bug 30678: (follow-up) Change call in opac scripts

Test plan:
See first patch. Add orgcode OCoLC.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: David Nind <david@davidnind.com>
Comment 18 Kyle M Hall 2022-07-22 16:23:40 UTC
Created attachment 138046 [details] [review]
Bug 30678: Add OCLC_NO as option to OPACSearchForTitleIn

We need to pass OCLC_NO as key to C4::Output::parametrized_url.
We get it from MARC21 035$a and strip the organizational code.

Test plan:
Add e.g. 62385712 in 035$a in a record.
Add e.g. following link to pref OPACSearchForTitleIn:
    <a  href="https://worldcat.org/search?q={OCLC_NO}" target="_blank">WorldCat (via OCLC number)</a>
Open that record on detail page. Click More searches. Follow that link.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 19 Kyle M Hall 2022-07-22 16:28:24 UTC
Created attachment 138047 [details] [review]
Bug 30678: Add OCLC_NO as option to OPACSearchForTitleIn

We need to pass OCLC_NO as key to C4::Output::parametrized_url.
We get it from MARC21 035$a and strip the organizational code.

Test plan:
Add e.g. 62385712 in 035$a in a record.
Add e.g. following link to pref OPACSearchForTitleIn:
    <a  href="https://worldcat.org/search?q={OCLC_NO}" target="_blank">WorldCat (via OCLC number)</a>
Open that record on detail page. Click More searches. Follow that link.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 20 Kyle M Hall 2022-07-22 16:28:34 UTC
Created attachment 138048 [details] [review]
Bug 30678: Adjust pref description

Test plan:
Look up pref OPACSearchForTitleIn.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 21 Kyle M Hall 2022-07-22 16:28:38 UTC
Created attachment 138049 [details] [review]
Bug 30678: (follow-up) Add oclc_number routine and friends

As requested by QA, we should match the orgcode.
Adding a few small routines in a Util module.

Test plan:
Run t/Koha/Util/MARC.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 22 Kyle M Hall 2022-07-22 16:28:42 UTC
Created attachment 138050 [details] [review]
Bug 30678: (follow-up) Change call in opac scripts

Test plan:
See first patch. Add orgcode OCoLC.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 23 Tomás Cohen Arazi 2022-07-22 18:19:11 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 24 Lucas Gass 2022-09-02 17:46:20 UTC
Enhancement will not be backported to 22.05.x series
Comment 25 Katrin Fischer 2022-09-06 10:37:05 UTC
Please don't forget about Needs Documenting.