Bug 20277

Summary: Link to host item doesn't work in analytical records if 773$a is present
Product: Koha Reporter: verolencinas <verolencinas>
Component: OPACAssignee: Katrin Fischer <katrin.fischer>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, kyle, martin.renvoize, victor
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11175
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00,21.05.05,20.11.11
Circulation function:
Attachments: Bug 20277: Improve 773 link when $a is present
Bug 20277: Improve 773 link when $a is present
Bug 20277: Improve 773 link when $a is present

Description verolencinas 2018-02-22 21:36:54 UTC
A lot of analytical records are made for serials. And for most of them the title is their primary access point. The OPAC and intranet link in the analytical record to the host item works well in these cases.
But if you have a 1XX field in your host item, this information goes in your 773$a subfield but the OPAC and intranet link in the analytical record to the host item includes 773$a and 773$t data but searches only in the title index. In this situation you can't retrieve the host item record.

Test:
- Create an analytical record for a (host)record with a 1XX field.
- Use the link in the analytical ("In" note) to retrieve the host record in the intranet client and the OPAC.
Comment 1 Martin Renvoize (ashimema) 2020-10-02 12:37:32 UTC
Is this still an issue.. changing to enhancement request as it's not received any attention.
Comment 2 Katrin Fischer 2021-08-24 11:32:35 UTC
Created attachment 124061 [details] [review]
Bug 20277: Improve 773 link when $a is present

At the moment $t (Title) and $a (Main heading - author) are both
searched in ti,phr, which sometimes may work, as ti contains the
full 245 field, including $c with author information. But often
$c will not match what is in 100$a, so the search fails.

This splits the search string so we search for $t in with ti,phr
and for $a in au.

To test:
- Make sure UseControlnumber is deactivated
- Search for a record with an author in 100 in your catalog
  Example from sample data: Programming Perl / Tom Christiansen, Brian D. Foy & Larry Wall.
- Add a child record using New > Add child record
- Verify that in 773 $a and $t are filled in
- Complete mandatory fields and save the record
. In OPAC and staff interface:
- Verify the link in the detail page is doing a search with ti,phr
- Verify the link works/doesn't work (more likely the latter)
- Apply patch
- Verify the link has changed and (now) works
Comment 3 Martin Renvoize (ashimema) 2021-09-06 10:50:29 UTC
Hmm, would it be possible to also get this added to the corresponding search which sets whether the 'Show analytics' link it visible or not (or depend on 11175 and update the search string method there?)
Comment 4 Martin Renvoize (ashimema) 2021-09-06 10:51:46 UTC
I'd love to DRY this search string out a bit honestly.. constructing it within the XSLT and also having an accessor for it in the Koha::Biblio objects isn't great practice.. perhaps we should pass it as an XSLT variable from the Biblio object and thus only have it built in one place.?
Comment 5 David Nind 2021-10-09 10:15:12 UTC
Created attachment 125990 [details] [review]
Bug 20277: Improve 773 link when $a is present

At the moment $t (Title) and $a (Main heading - author) are both
searched in ti,phr, which sometimes may work, as ti contains the
full 245 field, including $c with author information. But often
$c will not match what is in 100$a, so the search fails.

This splits the search string so we search for $t in with ti,phr
and for $a in au.

To test:
- Make sure UseControlnumber is deactivated
- Search for a record with an author in 100 in your catalog
  Example from sample data: Programming Perl / Tom Christiansen, Brian D. Foy & Larry Wall.
- Add a child record using New > Add child record
- Verify that in 773 $a and $t are filled in
- Complete mandatory fields and save the record
. In OPAC and staff interface:
- Verify the link in the detail page is doing a search with ti,phr
- Verify the link works/doesn't work (more likely the latter)
- Apply patch
- Verify the link has changed and (now) works

Signed-off-by: David Nind <david@davidnind.com>
Comment 6 Martin Renvoize (ashimema) 2021-10-18 15:38:19 UTC
Created attachment 126444 [details] [review]
Bug 20277: Improve 773 link when $a is present

At the moment $t (Title) and $a (Main heading - author) are both
searched in ti,phr, which sometimes may work, as ti contains the
full 245 field, including $c with author information. But often
$c will not match what is in 100$a, so the search fails.

This splits the search string so we search for $t in with ti,phr
and for $a in au.

To test:
- Make sure UseControlnumber is deactivated
- Search for a record with an author in 100 in your catalog
  Example from sample data: Programming Perl / Tom Christiansen, Brian D. Foy & Larry Wall.
- Add a child record using New > Add child record
- Verify that in 773 $a and $t are filled in
- Complete mandatory fields and save the record
. In OPAC and staff interface:
- Verify the link in the detail page is doing a search with ti,phr
- Verify the link works/doesn't work (more likely the latter)
- Apply patch
- Verify the link has changed and (now) works

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize (ashimema) 2021-10-18 15:39:07 UTC
Passing QA.. this works well.. I read it backwards... whilst it would be nice to DRY this code out too.. it's not this particular query I was thinking about it was the reverse one for looking up component parts.
Comment 8 Jonathan Druart 2021-10-19 07:44:51 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 9 Kyle M Hall (khall) 2021-10-22 15:12:45 UTC
Pushed to 21.05.x for 21.05.05
Comment 10 Fridolin Somers 2021-10-23 01:48:48 UTC
Pushed to 20.11.x for 20.11.11
Comment 11 Victor Grousset/tuxayo 2021-10-26 01:04:23 UTC
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.