Bug 38096 - Field 857 is not considered for display on XSLT files
Summary: Field 857 is not considered for display on XSLT files
Status: Patch doesn't apply
Alias: None
Product: Koha
Classification: Unclassified
Component: MARC Bibliographic data support (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Pedro Amorim
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-04 14:47 UTC by Pedro Amorim
Modified: 2024-11-12 12:11 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 38096: OPAC: Preparation (14.03 KB, patch)
2024-10-07 14:16 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 38096: OPAC: Move 856 logic to renderMARCOnlineResourceField utils (16.25 KB, patch)
2024-10-07 14:16 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 38096: OPAC: Display 857 on detail and results pages (4.08 KB, patch)
2024-10-07 14:16 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 38096: Staff: Display 857 to detail and results pages (16.31 KB, patch)
2024-10-07 14:16 UTC, Pedro Amorim
Details | Diff | Splinter Review
[DONT PUSH] Bug 38096: Add test data for fields 856 and 857 (9.62 KB, patch)
2024-10-07 14:18 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 38096: [DONT PUSH] Add test data for fields 856 and 857 (9.62 KB, patch)
2024-10-07 14:19 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 38096: OPAC: Preparation (14.09 KB, patch)
2024-10-08 15:27 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 38096: OPAC: Move 856 logic to renderMARCOnlineResourceField utils (16.31 KB, patch)
2024-10-08 15:27 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 38096: OPAC: Display 857 on detail and results pages (4.14 KB, patch)
2024-10-08 15:27 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 38096: Staff: Display 857 to detail and results pages (16.37 KB, patch)
2024-10-08 15:27 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 38096: [DONT PUSH] Add test data for fields 856 and 857 (9.69 KB, patch)
2024-10-08 15:27 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro Amorim 2024-10-04 14:47:39 UTC
Bug 34667 added MARC framework support for field 857 in MARC21 to 23.11 but it is not displayed.
Comment 1 Pedro Amorim 2024-10-07 14:16:04 UTC
Created attachment 172466 [details] [review]
Bug 38096: OPAC: Preparation

The OPAC logic for 856 in results page and detail page has diverged.
This commit ensures the 856 in the OPAC detail and search results pages
are consistent, in preparation to become DRY in the following commits.

With this DRY refactor, the following divergences are now aligned:
- 856 block now calls AddMissingProtocol regardless of value OPACURLOpenInNewWindow (previously was only being called if OPACURLOpenInNewWindow was 0). Now it's in line with what exists in MARC21slim2OPACDetail.xsl
- substring(,1,6)='image/' is also now a consideration when OPACURLOpenInNewWindow is 1. (previously was only being called if OPACURLOpenInNewWindow was 0). This is now in line with that exists in MARC21slim2OPACDetail.xsl
Comment 2 Pedro Amorim 2024-10-07 14:16:10 UTC
Created attachment 172467 [details] [review]
Bug 38096: OPAC: Move 856 logic to renderMARCOnlineResourceField utils

Now that OPAC detail and search results are consitent, we can DRY this
logic to its own function to be also utilized by 857 in the following
commit
Comment 3 Pedro Amorim 2024-10-07 14:16:17 UTC
Created attachment 172468 [details] [review]
Bug 38096: OPAC: Display 857 on detail and results pages
Comment 4 Pedro Amorim 2024-10-07 14:16:26 UTC
Created attachment 172469 [details] [review]
Bug 38096: Staff: Display 857 to detail and results pages

This work DRYs the 856 display logic to renderMARCOnlineResourceField.
This was previously written in detail and results pages.

Once this single function exists, 857 can also make use of it to be
displayed using the same logic/features already present for 856.

1) If testing k-t-d, add the test data for test plan (skip if sandboxes):
updatedatabase
2) Force reindex of this biblio by saving it, visit the biblio:
<staff_url>/cgi-bin/koha/catalogue/detail.pl?biblionumber=76
3) Click "Edit" -> "Edit record" -> "Save"
4) Open the following URL's, preferably on 4 different browser tabs (we're using biblio 76 for this test):
<staff_url>/cgi-bin/koha/catalogue/search.pl?q=music (first record [76] is the one we're testing)
<staff_url>/cgi-bin/koha/catalogue/detail.pl?biblionumber=76
<opac_url>/cgi-bin/koha/opac-search.pl?idx=&q=music (first record [76] is the one we're testing)
<opac_url>/cgi-bin/koha/opac-detail.pl?biblionumber=76
5) Verify that on all pages there are 3 instances of 856 (Online resources) and 3 instances of 857 (Online archive resources) with their respective link labels and URLs.
6) Click on the "Koha community no protocol" link for 856 and 857, notice the 'http://' protocol is added.
7) Change the values of OPACDisplay856uAsImage + Display856uAsImage and refresh the respective page. Verify it works as expected (respects the system preference). Note: This only applies for 856, not 857 (out of scope here).
8) Change the value of OPACURLOpenInNewWindow and click on the links before and after. Verify they respect the system preference.
Comment 5 Pedro Amorim 2024-10-07 14:18:32 UTC
Created attachment 172470 [details] [review]
[DONT PUSH] Bug 38096: Add test data for fields 856 and 857
Comment 6 Pedro Amorim 2024-10-07 14:19:09 UTC
Created attachment 172471 [details] [review]
Bug 38096: [DONT PUSH] Add test data for fields 856 and 857
Comment 7 Caroline Cyr La Rose 2024-10-08 15:27:16 UTC
Created attachment 172532 [details] [review]
Bug 38096: OPAC: Preparation

The OPAC logic for 856 in results page and detail page has diverged.
This commit ensures the 856 in the OPAC detail and search results pages
are consistent, in preparation to become DRY in the following commits.

With this DRY refactor, the following divergences are now aligned:
- 856 block now calls AddMissingProtocol regardless of value OPACURLOpenInNewWindow (previously was only being called if OPACURLOpenInNewWindow was 0). Now it's in line with what exists in MARC21slim2OPACDetail.xsl
- substring(,1,6)='image/' is also now a consideration when OPACURLOpenInNewWindow is 1. (previously was only being called if OPACURLOpenInNewWindow was 0). This is now in line with that exists in MARC21slim2OPACDetail.xsl

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 8 Caroline Cyr La Rose 2024-10-08 15:27:52 UTC
Created attachment 172533 [details] [review]
Bug 38096: OPAC: Move 856 logic to renderMARCOnlineResourceField utils

Now that OPAC detail and search results are consitent, we can DRY this
logic to its own function to be also utilized by 857 in the following
commit

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 9 Caroline Cyr La Rose 2024-10-08 15:27:54 UTC
Created attachment 172534 [details] [review]
Bug 38096: OPAC: Display 857 on detail and results pages

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 10 Caroline Cyr La Rose 2024-10-08 15:27:56 UTC
Created attachment 172535 [details] [review]
Bug 38096: Staff: Display 857 to detail and results pages

This work DRYs the 856 display logic to renderMARCOnlineResourceField.
This was previously written in detail and results pages.

Once this single function exists, 857 can also make use of it to be
displayed using the same logic/features already present for 856.

1) If testing k-t-d, add the test data for test plan (skip if sandboxes):
updatedatabase
2) Force reindex of this biblio by saving it, visit the biblio:
<staff_url>/cgi-bin/koha/catalogue/detail.pl?biblionumber=76
3) Click "Edit" -> "Edit record" -> "Save"
4) Open the following URL's, preferably on 4 different browser tabs (we're using biblio 76 for this test):
<staff_url>/cgi-bin/koha/catalogue/search.pl?q=music (first record [76] is the one we're testing)
<staff_url>/cgi-bin/koha/catalogue/detail.pl?biblionumber=76
<opac_url>/cgi-bin/koha/opac-search.pl?idx=&q=music (first record [76] is the one we're testing)
<opac_url>/cgi-bin/koha/opac-detail.pl?biblionumber=76
5) Verify that on all pages there are 3 instances of 856 (Online resources) and 3 instances of 857 (Online archive resources) with their respective link labels and URLs.
6) Click on the "Koha community no protocol" link for 856 and 857, notice the 'http://' protocol is added.
7) Change the values of OPACDisplay856uAsImage + Display856uAsImage and refresh the respective page. Verify it works as expected (respects the system preference). Note: This only applies for 856, not 857 (out of scope here).
8) Change the value of OPACURLOpenInNewWindow and click on the links before and after. Verify they respect the system preference.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 11 Caroline Cyr La Rose 2024-10-08 15:27:57 UTC
Created attachment 172536 [details] [review]
Bug 38096: [DONT PUSH] Add test data for fields 856 and 857

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 12 Caroline Cyr La Rose 2024-10-08 15:29:12 UTC
Thanks Pedro! 

In the test, I'd add to refresh the page in step 8 after changing the pref.

I hope I attached everything correctly... I don't often test bugs with many patches like this...
Comment 13 Pedro Amorim 2024-10-08 15:42:57 UTC
(In reply to Caroline Cyr La Rose from comment #12)
> Thanks Pedro! 
> 
> In the test, I'd add to refresh the page in step 8 after changing the pref.

That's great Caroline, thank you very much. 

(In reply to Caroline Cyr La Rose from comment #12)
> I hope I attached everything correctly... I don't often test bugs with many
> patches like this...

All patches seem to have been attached correctly. Thank you.
Comment 14 Pedro Amorim 2024-11-12 12:11:41 UTC
Patch no longer applies, updating here to come back to this later.