Bug 36111 - Online resource link should be based on the presence of 856$u (MARC21)
Summary: Online resource link should be based on the presence of 856$u (MARC21)
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: MARC Bibliographic data support (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Matthias Le Gac
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-15 21:52 UTC by Caroline Cyr La Rose
Modified: 2024-05-02 10:22 UTC (History)
9 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the display of 856 in the search results and detailed record, in the staff interface and OPAC. Currently, Koha displays "Click here to access online" if any 856 subfield is present, using the $u subfield as the link target, even if $u is empty. This patch makes the display of the online resource link depend on the presence of 856$u to prevent empty links.
Version(s) released in:


Attachments
Bug 36111: 856$h should not appear as a link in detailed record (37.84 KB, patch)
2024-02-21 17:16 UTC, Matthias Le Gac
Details | Diff | Splinter Review
Bug 36111: 856$h should not appear as a link in detailed record (37.89 KB, patch)
2024-02-24 22:16 UTC, David Nind
Details | Diff | Splinter Review
Bug 36111: 856$h should not appear as a link in detailed record (39.88 KB, patch)
2024-02-24 22:39 UTC, David Nind
Details | Diff | Splinter Review
Bug 36111: removes display of fields 856 if not 856 (4.84 KB, patch)
2024-03-25 20:40 UTC, Matthias Le Gac
Details | Diff | Splinter Review
Bug 36111: removes display of fields 856y3z if not 856u (4.84 KB, patch)
2024-03-27 19:18 UTC, Matthias Le Gac
Details | Diff | Splinter Review
Bug 36111: removes display of fields 856y3z if not 856u (6.88 KB, patch)
2024-03-29 20:13 UTC, Matthias Le Gac
Details | Diff | Splinter Review
Bug 36111: 856$h should not appear as a link in detailed record (39.92 KB, patch)
2024-04-02 14:05 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 36111: removes display of fields 856y3z if not 856u (6.93 KB, patch)
2024-04-02 14:05 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 36111: 856$h should not appear as a link in detailed record (39.98 KB, patch)
2024-04-04 15:25 UTC, Matthias Le Gac
Details | Diff | Splinter Review
Bug 36111: removes display of fields 856y3z if not 856u (4.84 KB, patch)
2024-04-04 15:30 UTC, Matthias Le Gac
Details | Diff | Splinter Review
Bug 36111: 856$h should not appear as a link in detailed record (22.39 KB, patch)
2024-04-05 13:24 UTC, Matthias Le Gac
Details | Diff | Splinter Review
Bug 36111: 856$h should not appear as a link in detailed record (22.44 KB, patch)
2024-04-20 18:52 UTC, Roman Dolny
Details | Diff | Splinter Review
Bug 36111: fixed extra space (5.04 KB, patch)
2024-04-22 17:17 UTC, Matthias Le Gac
Details | Diff | Splinter Review
Bug 36111: 856$h should not appear as a link in detailed record (22.49 KB, patch)
2024-04-22 19:13 UTC, David Nind
Details | Diff | Splinter Review
Bug 36111: fixed extra space (5.08 KB, patch)
2024-04-22 19:13 UTC, David Nind
Details | Diff | Splinter Review
Bug 36111: 856$h should not appear as a link in detailed record (22.56 KB, patch)
2024-04-23 08:52 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 36111: fixed extra space (5.15 KB, patch)
2024-04-23 08:52 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 36111: online resource link should be based on the presence of 856 (17.97 KB, patch)
2024-04-26 18:29 UTC, Matthias Le Gac
Details | Diff | Splinter Review
Bug 36111: 856$h should not appear as a link in detailed record (22.60 KB, patch)
2024-04-28 19:17 UTC, David Nind
Details | Diff | Splinter Review
Bug 36111: fixed extra space (5.19 KB, patch)
2024-04-28 19:17 UTC, David Nind
Details | Diff | Splinter Review
Bug 36111: online resource link should be based on the presence of 856 (18.02 KB, patch)
2024-04-28 19:17 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Caroline Cyr La Rose 2024-02-15 21:52:45 UTC
The newish MARC21 field 856$h is used to store non-functioning urls. However, if a record has data in 856$h (or any 856 subfield), a link "Click here to access online" appears in the results list and detailed record in the opac and the staff interface.

To replicate:
1. Add 856$h to MARC editor
   1.1. Go to Administration > MARC bibliographic frameworks
   1.2. Next to Default framework, click Actions > MARC structure
   1.3. Search for field 856
   1.4. Click Actions > Edit subfields
   1.5. Click h
   1.6. Check the Editor box
   1.7. Click Save changes

2. Catalog a new record with a random URL in 856$h
   2.1. Go to Cataloging
   2.2. Click New record
   2.3. Fill out the mandatory fields (000, 003, 005, 008, 040$c, 245$a, 942$c)
   2.4. Go to tab 8 and enter a value in 856$h
   2.5. Click Save (No need to add an item)

3. Search for the title in the staff interface (a large enough search to have more than one result)
   --> Notice it says "Online resources: Click here to access online"
   3.1. Try to click the link
        --> Blank page

4. Access the detailed record in the staff interface
   --> Notice it says "Online resources: Click here to access online"
   4.1. Try to click the link
        --> Blank page

5. Search for the title in the opac (a large enough search to have more than one result)
   --> Notice it says "Online resources: Click here to access online"
   5.1. Try to click the link
        --> Blank page

6. Access the detailed record in the opac
   --> Notice it says "Online resources: Click here to access online"
   6.1. Try to click the link
        --> Blank page

I don't think 856$h should trigger the link to appear. 

I managed to hide it from the OPAC by making 856$h invisible in the OPAC, but the link is still there in the staff interface and still leads nowhere...

In my opinion, if 856$h is to be displayed, it should only appear in the staff interface detailed record (not results list or opac), and only be regular text, not a link, with the mention (non functional).
Comment 1 Caroline Cyr La Rose 2024-02-15 21:53:36 UTC
Info about 856
https://www.loc.gov/marc/bibliographic/bd856.html

856$h Non-functioning Uniform Resource Identifier
Uniform Resource Identifier (URI), which is no longer functional, for example, due to link rot, content drift, etc.
Subfield $h may be repeated if there is more than one non-functioning URI. A note on the status change (including the date) may be added in either in subfield $x or subfield $z, depending on the local policy.
Comment 2 Caroline Cyr La Rose 2024-02-15 21:59:29 UTC
I also tried only filling out 856$s (file size) and the link appears.
Comment 3 Heather 2024-02-15 22:26:52 UTC
I was able to replicate this and IMO it's bad--very, very bad!  I even had "Is a URL:" in the Framework unchecked, and a clickable "Click here to access online" was still displayed.

I would completely hide this subfield in my OPAC *and* staff client, frankly!

(The label for the field should also be changed from "Processor of request" to "Non-functioning URI" to conform to the MARC21 standard. IMO.)
--h2
Comment 4 Caroline Cyr La Rose 2024-02-16 13:48:12 UTC
(In reply to Heather from comment #3)

> (The label for the field should also be changed from "Processor of request"
> to "Non-functioning URI" to conform to the MARC21 standard. IMO.)

This part was done in bug 34665. It's just that we don't update frameworks for existing installations.
Comment 5 Caroline Cyr La Rose 2024-02-16 13:52:40 UTC
(In reply to Heather from comment #3)

> I would completely hide this subfield in my OPAC *and* staff client, frankly!

I'm using this field for a migration where all the links have to be changed (the client is also changing their website at the same time, so the links won't work anymore). I'm using 856$h to store the "old" link. I think it's interesting to see it in the staff interface for that case, without having to go "edit" the record. But like we both mentioned, it should not trigger the link display.
Comment 6 Heather 2024-02-16 15:06:11 UTC
That's a great use of the field, Caroline--thank you for mentioning it!  (And that the frameworks aren't updated for existing installations--alerts me to some changes I might want to make!)

I could see this subfield being useful to use for staff access to a site vs. patron/public access, so it would be good to have this subfield display only in the staff client.
Comment 7 Matthias Le Gac 2024-02-21 17:16:14 UTC Comment hidden (obsolete)
Comment 8 Esther Melander 2024-02-23 17:27:03 UTC
I filed bug 36123 with my somewhat clumsy explanation on a related problem with configuring visibility for the 856 $u in the OPAC. The larger question is if 856$u is hidden, should any other fields with data still function as a link? I think no, especially if the URL checkbox is not checked for the other fields.
Comment 9 David Nind 2024-02-24 22:16:09 UTC Comment hidden (obsolete)
Comment 10 David Nind 2024-02-24 22:39:29 UTC
Created attachment 162406 [details] [review]
Bug 36111: 856$h should not appear as a link in detailed record

The newish MARC21 field 856$h is used to store non-functioning
URLs. However, if a record has data in 856$h (or any 856
subfield), a link "Click here to access online" appears in the
search results list and detailed record in the OPAC and the
staff interface.

This patch fixes this so that URLs in 856$h are not displayed
in the search results and record details pages.

Test plan:
1. Add 856$h to MARC editor
   1.1. Go to Administration > MARC bibliographic frameworks
   1.2. Next to Default framework, click Actions > MARC structure
   1.3. Search for field 856
   1.4. Click Actions > Edit subfields
   1.5. Click h
   1.6. Check the Editor box
   1.7. Click Save changes
2. Catalog a new record with a random URL in 856$h
   2.1. Go to Cataloging
   2.2. Click New record
   2.3. Fill out the mandatory fields (000, 003, 005, 008, 040$c,
        245$a, 942$c)
   2.4. Go to tab 8 and enter a value in 856$h
   2.5. Click Save (No need to add an item)
3. Search for the title in the staff interface (a large enough
   search to have more than one result)
   --> Notice it says "Online resources: Click here to access online"
   3.1. Try to click the link
        --> Blank page
4. Access the detailed record in the staff interface
   --> Notice it says "Online resources: Click here to access online"
   4.1. Try to click the link
        --> Blank page
5. Search for the title in the opac (a large enough search to have
   more than one result)
   --> Notice it says "Online resources: Click here to access online"
   5.1. Try to click the link
        --> Blank page
6. Access the detailed record in the opac
   --> Notice it says "Online resources: Click here to access online"
   6.1. Try to click the link
        --> Blank page
7. Apply the patch
8. Replay steps 3 through 6, but this time, the "Online resources"
   field should not be present.
9. Edit the item and add a url in field 856$u
10. Replay steps 3 through 6, but this time, clicking on the link
    should take you to the URL specified in the 856$u field.

Signed-off-by: David Nind <david@davidnind.com>
Comment 11 David Nind 2024-02-24 22:48:35 UTC
For some reason, when I signed off the patch the test plan was not included. I have amended the patch to include a description and have added the (very good) test plan. Feel free to amend if I have not got it right.

I have also added Matthias as the assignee, changed the importance from enhancement to normal (as it is a bug), and added some text for the release notes.

Testing notes using koha-testing-docker (KTD):

1. If using Firefox, instead of a blank page nothing happens. You get a blank page using a Chromium-based browser (such as Chromium or Google Chrome).
Comment 12 Victor Grousset/tuxayo 2024-03-05 07:12:09 UTC
> For some reason, when I signed off the patch the test plan was not
> included. I have amended the patch to include a description and
> have added the (very good) test plan.

Thanks David for the help :)
 	
@Matthias I think that happens when the test plan is not written in the commit message but written in bugzilla's UI/git-bz when attaching a patch. The test plan needs to be in the commit message to be preserved between signoffs and in the Koha commit history.

---

If that can help someone to review this, here a git command to show the diff with additional colors for moved lines. To go more quickly and just checking that part of the stuff is just moved and not new or totally removed.

git show --color-moved --color-moved-ws=allow-indentation-change

That's was still not enough for me to be able to get a good grasp of this one, sorry ^^"
Comment 13 Matthias Le Gac 2024-03-05 17:03:03 UTC
(In reply to Victor Grousset/tuxayo from comment #12)
> > For some reason, when I signed off the patch the test plan was not
> > included. I have amended the patch to include a description and
> > have added the (very good) test plan.
> 
> Thanks David for the help :)
>  	
> @Matthias I think that happens when the test plan is not written in the
> commit message but written in bugzilla's UI/git-bz when attaching a patch.
> The test plan needs to be in the commit message to be preserved between
> signoffs and in the Koha commit history.
> 
> ---
> 
> If that can help someone to review this, here a git command to show the diff
> with additional colors for moved lines. To go more quickly and just checking
> that part of the stuff is just moved and not new or totally removed.
> 
> git show --color-moved --color-moved-ws=allow-indentation-change
> 
> That's was still not enough for me to be able to get a good grasp of this
> one, sorry ^^"

thank for the help, I need to amend the commit to attach the test plan ?
Comment 14 Victor Grousset/tuxayo 2024-03-05 23:54:29 UTC
No need, David did it when signing off :)
Comment 15 Matthias Le Gac 2024-03-25 20:40:14 UTC Comment hidden (obsolete)
Comment 16 Victor Grousset/tuxayo 2024-03-27 02:55:58 UTC
Hi :)

The second patch now duplicates the test plan of the 1st patch. That will cause confusion.

About the switch back to Needs Signoff: are the steps to test the additional changes the same? Or is there something additional to check about these latest changes?

The idea is that if someone would forget to apply the second patch, when testing, they should not get what is expected. Thus demonstrating that the test plan really tests the changes. If not, that means the test plan isn't complete enough.
No need to have manual tests showing every single change made by the patches. It's a balance to show enough of the functional changes and edge cases and to demonstrate that the related code works.
Comment 17 Matthias Le Gac 2024-03-27 18:24:08 UTC
Ok I understand I will change the plan test to test the fix
Comment 18 Matthias Le Gac 2024-03-27 19:18:08 UTC
Created attachment 164029 [details] [review]
Bug 36111: removes display of fields 856y3z if not 856u

Test plan:
1. Add 856$h to MARC editor
   1.1. Go to Administration > MARC bibliographic frameworks
   1.2. Next to Default framework, click Actions > MARC structure
   1.3. Search for field 856
   1.4. Click Actions > Edit subfields
   1.5. Click h
   1.6. Check the Editor box
   1.7. Click Save changes
2. Catalog a new record with a random URL in 856$h
   2.1. Go to Cataloging
   2.2. Click New record
   2.3. Fill out the mandatory fields (000, 003, 005, 008, 040$c,
        245$a, 942$c)
   2.4. Go to tab 8 and enter a value in 856$h
   2.5. Click Save (No need to add an item)
3. Search for the title in the staff interface (a large enough
   search to have more than one result)
   --> Notice it says "Online resources: Click here to access online"
   3.1. Try to click the link
        --> Blank page
4. Access the detailed record in the staff interface
   --> Notice it says "Online resources: Click here to access online"
   4.1. Try to click the link
        --> Blank page
5. Search for the title in the opac (a large enough search to have
   more than one result)
   --> Notice it says "Online resources: Click here to access online"
   5.1. Try to click the link
        --> Blank page
6. Access the detailed record in the opac
   --> Notice it says "Online resources: Click here to access online"
   6.1. Try to click the link
        --> Blank page
7. Edit the item and add a text in field 856$y
8. Access the detailed record in the staff interface
   --> Notice it says what you put in 856$y field
9. Apply the patch
10. Replay steps 3 through 6, but this time, the "Online resources"
   field should not be present.
11. Replay steps 7 through 8, but this time, what you put in 856$y
   field should not be present.
12. Edit the item and add a url in field 856$u
13. Replay steps 3 through 6, but this time, clicking on the link
    should take you to the URL specified in the 856$u field.
14. Replay steps 7 through 8, but this time, what you put in 856$y
   field should be present and 
   clicking on the link should take you to the URL specified in the 856$u field.
   
Before the second patch, if you put something in the 856$y field and there was nothing in the 856$u field, the text was displayed. 
Now, with the second patch, the problem has been solved.
Comment 19 Victor Grousset/tuxayo 2024-03-28 19:00:03 UTC
Thanks for the additional steps :)
The back to need signoff now is clear, there is additional behavior to test.

Remaining is the issue of the 1st patch having the old test plan. So there is duplication and someone coming to test is likely to miss the full test plan in the 2nd patch. And signoff without having actually tested the last changes.
Comment 20 Matthias Le Gac 2024-03-29 20:13:42 UTC
Created attachment 164151 [details] [review]
Bug 36111: removes display of fields 856y3z if not 856u

Test plan:
1. Add 856$h to MARC editor
   1.1. Go to Administration > MARC bibliographic frameworks
   1.2. Next to Default framework, click Actions > MARC structure
   1.3. Search for field 856
   1.4. Click Actions > Edit subfields
   1.5. Click h
   1.6. Check the Editor box
   1.7. Click Save changes
2. Catalog a new record with a random URL in 856$h
   2.1. Go to Cataloging
   2.2. Click New record
   2.3. Fill out the mandatory fields (000, 003, 005, 008, 040$c,
        245$a, 942$c)
   2.4. Go to tab 8 and enter a value in 856$h
   2.5. Click Save (No need to add an item)
3. Search for the title in the staff interface (a large enough
   search to have more than one result)
   --> Notice it says "Online resources: Click here to access online"
   3.1. Try to click the link
        --> Blank page
4. Access the detailed record in the staff interface
   --> Notice it says "Online resources: Click here to access online"
   4.1. Try to click the link
        --> Blank page
5. Search for the title in the opac (a large enough search to have
   more than one result)
   --> Notice it says "Online resources: Click here to access online"
   5.1. Try to click the link
        --> Blank page
6. Access the detailed record in the opac
   --> Notice it says "Online resources: Click here to access online"
   6.1. Try to click the link
        --> Blank page
7. Edit the item and add a text in field 856$y
8. Access the detailed record in the staff interface
   --> Notice it says what you put in 856$y field
9. Apply the patch
10. Replay steps 3 through 6, but this time, the "Online resources"
   field should not be present.
11. Replay steps 7 through 8, but this time, what you put in 856$y
   field should not be present.
12. Edit the item and add a url in field 856$u
13. Replay steps 3 through 6, but this time, clicking on the link
    should take you to the URL specified in the 856$u field.
14. Replay steps 7 through 8, but this time, what you put in 856$y
   field should be present and
   clicking on the link should take you to the URL specified in the 856$u field.
Comment 21 Matthias Le Gac 2024-03-29 20:14:50 UTC
I put the test plan in the commit message
It's better now?
Comment 22 Owen Leonard 2024-04-02 14:05:19 UTC
Created attachment 164275 [details] [review]
Bug 36111: 856$h should not appear as a link in detailed record

The newish MARC21 field 856$h is used to store non-functioning
URLs. However, if a record has data in 856$h (or any 856
subfield), a link "Click here to access online" appears in the
search results list and detailed record in the OPAC and the
staff interface.

This patch fixes this so that URLs in 856$h are not displayed
in the search results and record details pages.

Test plan:
1. Add 856$h to MARC editor
   1.1. Go to Administration > MARC bibliographic frameworks
   1.2. Next to Default framework, click Actions > MARC structure
   1.3. Search for field 856
   1.4. Click Actions > Edit subfields
   1.5. Click h
   1.6. Check the Editor box
   1.7. Click Save changes
2. Catalog a new record with a random URL in 856$h
   2.1. Go to Cataloging
   2.2. Click New record
   2.3. Fill out the mandatory fields (000, 003, 005, 008, 040$c,
        245$a, 942$c)
   2.4. Go to tab 8 and enter a value in 856$h
   2.5. Click Save (No need to add an item)
3. Search for the title in the staff interface (a large enough
   search to have more than one result)
   --> Notice it says "Online resources: Click here to access online"
   3.1. Try to click the link
        --> Blank page
4. Access the detailed record in the staff interface
   --> Notice it says "Online resources: Click here to access online"
   4.1. Try to click the link
        --> Blank page
5. Search for the title in the opac (a large enough search to have
   more than one result)
   --> Notice it says "Online resources: Click here to access online"
   5.1. Try to click the link
        --> Blank page
6. Access the detailed record in the opac
   --> Notice it says "Online resources: Click here to access online"
   6.1. Try to click the link
        --> Blank page
7. Apply the patch
8. Replay steps 3 through 6, but this time, the "Online resources"
   field should not be present.
9. Edit the item and add a url in field 856$u
10. Replay steps 3 through 6, but this time, clicking on the link
    should take you to the URL specified in the 856$u field.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 23 Owen Leonard 2024-04-02 14:05:22 UTC
Created attachment 164276 [details] [review]
Bug 36111: removes display of fields 856y3z if not 856u

Test plan:
1. Add 856$h to MARC editor
   1.1. Go to Administration > MARC bibliographic frameworks
   1.2. Next to Default framework, click Actions > MARC structure
   1.3. Search for field 856
   1.4. Click Actions > Edit subfields
   1.5. Click h
   1.6. Check the Editor box
   1.7. Click Save changes
2. Catalog a new record with a random URL in 856$h
   2.1. Go to Cataloging
   2.2. Click New record
   2.3. Fill out the mandatory fields (000, 003, 005, 008, 040$c,
        245$a, 942$c)
   2.4. Go to tab 8 and enter a value in 856$h
   2.5. Click Save (No need to add an item)
3. Search for the title in the staff interface (a large enough
   search to have more than one result)
   --> Notice it says "Online resources: Click here to access online"
   3.1. Try to click the link
        --> Blank page
4. Access the detailed record in the staff interface
   --> Notice it says "Online resources: Click here to access online"
   4.1. Try to click the link
        --> Blank page
5. Search for the title in the opac (a large enough search to have
   more than one result)
   --> Notice it says "Online resources: Click here to access online"
   5.1. Try to click the link
        --> Blank page
6. Access the detailed record in the opac
   --> Notice it says "Online resources: Click here to access online"
   6.1. Try to click the link
        --> Blank page
7. Edit the item and add a text in field 856$y
8. Access the detailed record in the staff interface
   --> Notice it says what you put in 856$y field
9. Apply the patch
10. Replay steps 3 through 6, but this time, the "Online resources"
   field should not be present.
11. Replay steps 7 through 8, but this time, what you put in 856$y
   field should not be present.
12. Edit the item and add a url in field 856$u
13. Replay steps 3 through 6, but this time, clicking on the link
    should take you to the URL specified in the 856$u field.
14. Replay steps 7 through 8, but this time, what you put in 856$y
   field should be present and
   clicking on the link should take you to the URL specified in the 856$u field.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 24 Victor Grousset/tuxayo 2024-04-02 22:09:43 UTC
(In reply to Matthias Le Gac from comment #21)
> I put the test plan in the commit message

I missed that there was again the 1st mistake: so indeed the patch on comment 18 didn't have the test plan and it would have been lost on Owen's signoff. So thanks for fixing this. The most reliable approach is to not use the comment function when attaching patches. Everything related to the patch itself should be in the commit message. And additional comments should be written in a separate bugzilla comment.

> It's better now?

What I meant in comment 19 by duplication is that when looking at the latest version of :
- Bug 36111: 856$h should not appear as a link in detailed record
- Bug 36111: removes display of fields 856y3z if not 856u

they are 80% duplicate and it's the second one that is the complete one. So it's easy to miss.
To fix this, the full test plan should be put in the 1st commit. And it should be removed from the 2nd commit. So there is only one test plan and it's complete.
(there is a gotcha when doing back and forths for the 1st time with patches on bugzilla: grab the patches from bugzilla and not from your local branch before starting working on changes, to not loose the signoff that have been added here)
Comment 25 Victor Grousset/tuxayo 2024-04-02 22:10:18 UTC
@Owen when you signed-off, did you use the full test plan that is in the second commit?
Comment 26 Matthias Le Gac 2024-04-04 15:25:48 UTC
Created attachment 164429 [details] [review]
Bug 36111: 856$h should not appear as a link in detailed record

Test plan:
1. Add 856$h to MARC editor
   1.1. Go to Administration > MARC bibliographic frameworks
   1.2. Next to Default framework, click Actions > MARC structure
   1.3. Search for field 856
   1.4. Click Actions > Edit subfields
   1.5. Click h
   1.6. Check the Editor box
   1.7. Click Save changes
2. Catalog a new record with a random URL in 856$h
   2.1. Go to Cataloging
   2.2. Click New record
   2.3. Fill out the mandatory fields (000, 003, 005, 008, 040$c,
        245$a, 942$c)
   2.4. Go to tab 8 and enter a value in 856$h
   2.5. Click Save (No need to add an item)
3. Search for the title in the staff interface (a large enough
   search to have more than one result)
   --> Notice it says "Online resources: Click here to access online"
   3.1. Try to click the link
        --> Blank page
4. Access the detailed record in the staff interface
   --> Notice it says "Online resources: Click here to access online"
   4.1. Try to click the link
        --> Blank page
5. Search for the title in the opac (a large enough search to have
   more than one result)
   --> Notice it says "Online resources: Click here to access online"
   5.1. Try to click the link
        --> Blank page
6. Access the detailed record in the opac
   --> Notice it says "Online resources: Click here to access online"
   6.1. Try to click the link
        --> Blank page
7. Edit the item and add a text in field 856$y
8. Access the detailed record in the staff interface
   --> Notice it says what you put in 856$y field
9. Apply the patch
10. Replay steps 3 through 6, but this time, the "Online resources"
   field should not be present.
11. Replay steps 7 through 8, but this time, what you put in 856$y
   field should not be present.
12. Edit the item and add a url in field 856$u
13. Replay steps 3 through 6, but this time, clicking on the link
    should take you to the URL specified in the 856$u field.
14. Replay steps 7 through 8, but this time, what you put in 856$y
   field should be present and
   clicking on the link should take you to the URL specified in the 856$u field.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>


Current status: Signed Off
Comment 27 Matthias Le Gac 2024-04-04 15:30:35 UTC
Created attachment 164430 [details] [review]
Bug 36111: removes display of fields 856y3z if not 856u

Current status: Signed Off
Comment 28 Matthias Le Gac 2024-04-04 15:34:44 UTC

(In reply to Victor Grousset/tuxayo from comment #24)

I put the last test plan in the first commit and removed the test plan in the second commit.
Comment 29 Matthias Le Gac 2024-04-04 15:37:57 UTC
Philippe Blouin has asked me to simplify my changes, so I'm passing the task back to Failed QA until I attach the changes, which will have no impact on the test plan.
Comment 30 Matthias Le Gac 2024-04-05 13:24:31 UTC
Created attachment 164476 [details] [review]
Bug 36111: 856$h should not appear as a link in detailed record

Test plan:
1. Add 856$h to MARC editor
   1.1. Go to Administration > MARC bibliographic frameworks
   1.2. Next to Default framework, click Actions > MARC structure
   1.3. Search for field 856
   1.4. Click Actions > Edit subfields
   1.5. Click h
   1.6. Check the Editor box
   1.7. Click Save changes
2. Catalog a new record with a random URL in 856$h
   2.1. Go to Cataloging
   2.2. Click New record
   2.3. Fill out the mandatory fields (000, 003, 005, 008, 040$c,
        245$a, 942$c)
   2.4. Go to tab 8 and enter a value in 856$h
   2.5. Click Save (No need to add an item)
3. Search for the title in the staff interface (a large enough
   search to have more than one result)
   --> Notice it says "Online resources: Click here to access online"
   3.1. Try to click the link
        --> Blank page
4. Access the detailed record in the staff interface
   --> Notice it says "Online resources: Click here to access online"
   4.1. Try to click the link
        --> Blank page
5. Search for the title in the opac (a large enough search to have
   more than one result)
   --> Notice it says "Online resources: Click here to access online"
   5.1. Try to click the link
        --> Blank page
6. Access the detailed record in the opac
   --> Notice it says "Online resources: Click here to access online"
   6.1. Try to click the link
        --> Blank page
7. Edit the item and add a text in field 856$y
8. Access the detailed record in the staff interface
   --> Notice it says what you put in 856$y field
9. Apply the patch
10. Replay steps 3 through 6, but this time, the "Online resources"
   field should not be present.
11. Replay steps 7 through 8, but this time, what you put in 856$y
   field should not be present.
12. Edit the item and add a url in field 856$u
13. Replay steps 3 through 6, but this time, clicking on the link
    should take you to the URL specified in the 856$u field.
14. Replay steps 7 through 8, but this time, what you put in 856$y
   field should be present and
   clicking on the link should take you to the URL specified in the 856$u field.
Comment 31 Matthias Le Gac 2024-04-05 13:28:35 UTC
When I had made my modifications in the first commit, I had indented the code, which generated a lot of differences with the code and didn't make it easy to understand where I had really made the modifications. So I redid the minimal changes, which had no impact on the test plan, and put them in the commit.
Comment 32 Victor Grousset/tuxayo 2024-04-17 19:16:01 UTC
Do you confirm the commit/patch "Bug 36111: removes display of fields 856y3z if not 856u" isn't needed anymore?

Asking in case there was a confusion about removing the duplicate test plan: it was about amending the commit to remove the duplicate test plan. And reattach it here which would replace the previous version.

Here what happened is that the 2nd commit isn't here anymore. But if the rework also made the 2nd commit totally unnecessary then, all good :)
Comment 33 Matthias Le Gac 2024-04-17 19:22:18 UTC
(In reply to Victor Grousset/tuxayo from comment #32)
> Do you confirm the commit/patch "Bug 36111: removes display of fields 856y3z
> if not 856u" isn't needed anymore?
> 
> Asking in case there was a confusion about removing the duplicate test plan:
> it was about amending the commit to remove the duplicate test plan. And
> reattach it here which would replace the previous version.
> 
> Here what happened is that the 2nd commit isn't here anymore. But if the
> rework also made the 2nd commit totally unnecessary then, all good :)

Yes, the commit/patch "Bug 36111 : suppresses the display of fields 856y3z if they are not 856u" is no longer useful because when I simplified my modifications I fussed the two commits to make it simpler and have a single commit/patch that has all the modifications with the least number of modified lines.
Sorry for the confusion.
Comment 34 Roman Dolny 2024-04-20 18:52:06 UTC
Created attachment 165236 [details] [review]
Bug 36111: 856$h should not appear as a link in detailed record

Test plan:
1. Add 856$h to MARC editor
   1.1. Go to Administration > MARC bibliographic frameworks
   1.2. Next to Default framework, click Actions > MARC structure
   1.3. Search for field 856
   1.4. Click Actions > Edit subfields
   1.5. Click h
   1.6. Check the Editor box
   1.7. Click Save changes
2. Catalog a new record with a random URL in 856$h
   2.1. Go to Cataloging
   2.2. Click New record
   2.3. Fill out the mandatory fields (000, 003, 005, 008, 040$c,
        245$a, 942$c)
   2.4. Go to tab 8 and enter a value in 856$h
   2.5. Click Save (No need to add an item)
3. Search for the title in the staff interface (a large enough
   search to have more than one result)
   --> Notice it says "Online resources: Click here to access online"
   3.1. Try to click the link
        --> Blank page
4. Access the detailed record in the staff interface
   --> Notice it says "Online resources: Click here to access online"
   4.1. Try to click the link
        --> Blank page
5. Search for the title in the opac (a large enough search to have
   more than one result)
   --> Notice it says "Online resources: Click here to access online"
   5.1. Try to click the link
        --> Blank page
6. Access the detailed record in the opac
   --> Notice it says "Online resources: Click here to access online"
   6.1. Try to click the link
        --> Blank page
7. Edit the item and add a text in field 856$y
8. Access the detailed record in the staff interface
   --> Notice it says what you put in 856$y field
9. Apply the patch
10. Replay steps 3 through 6, but this time, the "Online resources"
   field should not be present.
11. Replay steps 7 through 8, but this time, what you put in 856$y
   field should not be present.
12. Edit the item and add a url in field 856$u
13. Replay steps 3 through 6, but this time, clicking on the link
    should take you to the URL specified in the 856$u field.
14. Replay steps 7 through 8, but this time, what you put in 856$y
   field should be present and
   clicking on the link should take you to the URL specified in the 856$u field.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Comment 35 David Nind 2024-04-22 10:35:23 UTC
I had a go at testing, not realising it had already been signed off.

Everything works as per the test plan.

However, something is not quite right with the spacing between labels and information when the 856$h and $y are not displayed (after the patch is applied). 

It is very subtle (to replicate with patch applied, edit the book framework, use biblionumber 262 (Programming Perl), and searched for perl):

1. $856$h and $y: 
   - Staff interface - search results: extra space after 'Edition'
   - Staff interface - details page: extra space between 'LOC classification' and 'OPAC view' 
   - OPAC - search results: extra space between 'Publication detail' and 'Availability'
   - OPAC - details page: extra space between 'LOC classification' and 'Tags from this library'

2. $856$u and $y: displays correctly in search results and details page (for both the staff interface and OPAC)

If you use the element selector, you can see there is an extra green line (with different pixel sizes depending on location) with these classes:
- Staff interface - results and details page: span.results_summary.online_resources (6.5px)
- OPAC - results page: div.results_summary.online_resources (6.12px)
- OPAC - details page: span.results_summary.online_resources (6.8px)
Comment 36 Matthias Le Gac 2024-04-22 17:17:20 UTC
Created attachment 165335 [details] [review]
Bug 36111: fixed extra space
Comment 37 Matthias Le Gac 2024-04-22 17:21:11 UTC
I fixed the problem when "online resources" is not displayed. There is no longer an extra space between fields. 

As for the second problem, it's not related to this bz because the difference is that it's remapped depending on the page. This is present between any field and whether the patch is applied or not.
Comment 38 David Nind 2024-04-22 19:12:45 UTC
(In reply to Matthias Le Gac from comment #37)
> I fixed the problem when "online resources" is not displayed. There is no
> longer an extra space between fields. 
> 
> As for the second problem, it's not related to this bz because the
> difference is that it's remapped depending on the page. This is present
> between any field and whether the patch is applied or not.

Thanks Matthias!

Sign off on the way.

Hope QA goes smoothly!

David
Comment 39 David Nind 2024-04-22 19:13:23 UTC
Created attachment 165346 [details] [review]
Bug 36111: 856$h should not appear as a link in detailed record

Test plan:
1. Add 856$h to MARC editor
   1.1. Go to Administration > MARC bibliographic frameworks
   1.2. Next to Default framework, click Actions > MARC structure
   1.3. Search for field 856
   1.4. Click Actions > Edit subfields
   1.5. Click h
   1.6. Check the Editor box
   1.7. Click Save changes
2. Catalog a new record with a random URL in 856$h
   2.1. Go to Cataloging
   2.2. Click New record
   2.3. Fill out the mandatory fields (000, 003, 005, 008, 040$c,
        245$a, 942$c)
   2.4. Go to tab 8 and enter a value in 856$h
   2.5. Click Save (No need to add an item)
3. Search for the title in the staff interface (a large enough
   search to have more than one result)
   --> Notice it says "Online resources: Click here to access online"
   3.1. Try to click the link
        --> Blank page
4. Access the detailed record in the staff interface
   --> Notice it says "Online resources: Click here to access online"
   4.1. Try to click the link
        --> Blank page
5. Search for the title in the opac (a large enough search to have
   more than one result)
   --> Notice it says "Online resources: Click here to access online"
   5.1. Try to click the link
        --> Blank page
6. Access the detailed record in the opac
   --> Notice it says "Online resources: Click here to access online"
   6.1. Try to click the link
        --> Blank page
7. Edit the item and add a text in field 856$y
8. Access the detailed record in the staff interface
   --> Notice it says what you put in 856$y field
9. Apply the patch
10. Replay steps 3 through 6, but this time, the "Online resources"
   field should not be present.
11. Replay steps 7 through 8, but this time, what you put in 856$y
   field should not be present.
12. Edit the item and add a url in field 856$u
13. Replay steps 3 through 6, but this time, clicking on the link
    should take you to the URL specified in the 856$u field.
14. Replay steps 7 through 8, but this time, what you put in 856$y
   field should be present and
   clicking on the link should take you to the URL specified in the 856$u field.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: David Nind <david@davidnind.com>
Comment 40 David Nind 2024-04-22 19:13:26 UTC
Created attachment 165347 [details] [review]
Bug 36111: fixed extra space

Signed-off-by: David Nind <david@davidnind.com>
Comment 41 Martin Renvoize 2024-04-23 08:52:08 UTC
Created attachment 165355 [details] [review]
Bug 36111: 856$h should not appear as a link in detailed record

Test plan:
1. Add 856$h to MARC editor
   1.1. Go to Administration > MARC bibliographic frameworks
   1.2. Next to Default framework, click Actions > MARC structure
   1.3. Search for field 856
   1.4. Click Actions > Edit subfields
   1.5. Click h
   1.6. Check the Editor box
   1.7. Click Save changes
2. Catalog a new record with a random URL in 856$h
   2.1. Go to Cataloging
   2.2. Click New record
   2.3. Fill out the mandatory fields (000, 003, 005, 008, 040$c,
        245$a, 942$c)
   2.4. Go to tab 8 and enter a value in 856$h
   2.5. Click Save (No need to add an item)
3. Search for the title in the staff interface (a large enough
   search to have more than one result)
   --> Notice it says "Online resources: Click here to access online"
   3.1. Try to click the link
        --> Blank page
4. Access the detailed record in the staff interface
   --> Notice it says "Online resources: Click here to access online"
   4.1. Try to click the link
        --> Blank page
5. Search for the title in the opac (a large enough search to have
   more than one result)
   --> Notice it says "Online resources: Click here to access online"
   5.1. Try to click the link
        --> Blank page
6. Access the detailed record in the opac
   --> Notice it says "Online resources: Click here to access online"
   6.1. Try to click the link
        --> Blank page
7. Edit the item and add a text in field 856$y
8. Access the detailed record in the staff interface
   --> Notice it says what you put in 856$y field
9. Apply the patch
10. Replay steps 3 through 6, but this time, the "Online resources"
   field should not be present.
11. Replay steps 7 through 8, but this time, what you put in 856$y
   field should not be present.
12. Edit the item and add a url in field 856$u
13. Replay steps 3 through 6, but this time, clicking on the link
    should take you to the URL specified in the 856$u field.
14. Replay steps 7 through 8, but this time, what you put in 856$y
   field should be present and
   clicking on the link should take you to the URL specified in the 856$u field.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 42 Martin Renvoize 2024-04-23 08:52:11 UTC
Created attachment 165356 [details] [review]
Bug 36111: fixed extra space

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 43 Martin Renvoize 2024-04-23 08:52:40 UTC
This makes sense to me and code is reasonably clear.

Passing QA
Comment 44 Katrin Fischer 2024-04-26 06:31:37 UTC
I am not sure about the proposed patches here as what they actually do and what is advertised in the bug title doesn't match up.

1) This changes the current behavior beyond not displaying $h: 

We won't be displaying any "Online resources" info if there isn't a $u. The LOC documentation lists a few examüles where we don't have a $u:

https://www.loc.gov/marc/bibliographic/bd856.html

856 	1#$amaine.maine.edu$cMust be decompressed with PKUNZIP$fresource.zip
856 	0#$akentvm.bitnet$facadlist file1$facadlist file2$facadlist file3
856 	0#$auicvm.bitnet$fAN2
856 	2#$amadlab.sprl.umich.edu$p3000
856 	10$zFTP access to PostScript version includes groups of article files with .pdf extension$aftp.cdc.gov$d/pub/EIS/vol*no*/adobe$f*.pdf$qapplication/pdf 

So are we sure there are no unintended side effects of this change?

2) I am not sure what this line does - but including style inline is usually not quite a good sign:

<xsl:attribute name="style">pointer-events: none; color: #202020;</xsl:attribute>

3) This does look overly complicated:

     <xsl:if test="marc:datafield[@tag=856]">
+        <xsl:if test="marc:datafield[@tag=856]/marc:subfield[@code='u']">

In full:

    <xsl:if test="marc:datafield[@tag=856]">
        <xsl:if test="marc:datafield[@tag=856]/marc:subfield[@code='u']">
        <span class="results_summary online_resources">
                <span class="label">Online resources: </span>
                    <xsl:for-each select="marc:datafield[@tag=856]">


So: Check if 856 exists... check if at least one of those has a $u... then loop over all 856 again. If we really want to limit display to only 856 with $u it would make sense to check for at least one with... and then adjust the for-each to only loop over those with $u.

4) This will just result in a broken link when there is no $u, it won't take care of removing the whole link from the HTML. It's either not needed as we check $u before, or it results in a broken link:

+                                <xsl:when test="marc:subfield[@code='u']">
                                     <xsl:text>Click here to access online</xsl:text>
-                                </xsl:otherwise>
+                                </xsl:when>


5) If we only select the 856 with $u for looping, this change won't be required. Also: it doesn't look right. Before we ask:

Is this the last, then show " ", otherwise print |.
Now it's turned into a really complex expression.

if we have (y or 3 or z or u) and (u) - at least one u too many:

-                <xsl:otherwise> | </xsl:otherwise>
+                <xsl:when test="(marc:subfield[@code='y'] or marc:subfield[@code='3'] or marc:subfield[@code='z'] or marc:subfield[@code='u']) and marc:subfield[@code='u']"><xsl:text> | </xsl:text></xsl:when>
Comment 45 Katrin Fischer 2024-04-26 08:09:53 UTC
I accidentally pushed this to main, but will revert, I think easier and less confusing to push a clean patch later. Please let me know if I can help - I have done quite a bit of XSLT work.
Comment 46 Caroline Cyr La Rose 2024-04-26 13:57:32 UTC
(In reply to Katrin Fischer from comment #44)
> I am not sure about the proposed patches here as what they actually do and
> what is advertised in the bug title doesn't match up.
> 
> 1) This changes the current behavior beyond not displaying $h: 
> 
> We won't be displaying any "Online resources" info if there isn't a $u. The
> LOC documentation lists a few examüles where we don't have a $u:
> 
> https://www.loc.gov/marc/bibliographic/bd856.html
> 
> 856 	1#$amaine.maine.edu$cMust be decompressed with PKUNZIP$fresource.zip
> 856 	0#$akentvm.bitnet$facadlist file1$facadlist file2$facadlist file3
> 856 	0#$auicvm.bitnet$fAN2
> 856 	2#$amadlab.sprl.umich.edu$p3000
> 856 	10$zFTP access to PostScript version includes groups of article files
> with .pdf
> extension$aftp.cdc.gov$d/pub/EIS/vol*no*/adobe$f*.pdf$qapplication/pdf 
> 
> So are we sure there are no unintended side effects of this change?
> 

I can't really answer the more technical questions, I will leave this to Matthias, but I can answer this one. Currently, there is a link "Click here to access online" whether there is a $u or not and the href is the contents of the $u. That is definitely not wanted, I don't think. If anyone currently uses the 856 field without $u, they must have display problems. 

I think the 856$u alternative in MARC is to use a combination of $a, $d, and $f. Those subfields are currently not supported in the XSLT.  

I don't really see how we could introduce a regression if the current behaviour is broken and the alternative behaviour is not implemented.

You're right that it kind of veered off from the title of the bug. It started with my issue with 856$h, but as Matthias looked at the code, we noticed that only $3, $u, $y and $z were implemented in the display, with the $u as the href and it was displayed if there is any 856 subfield. Since the link depends on the $u, I instructed him to hide the whole thing if there is no $u. I will change the bug's title to reflect more the current behaviour.

If we want to implement $a/$d/$f for those who use it, I think it should be done in the context of another bug.
Comment 47 Matthias Le Gac 2024-04-26 14:07:41 UTC
I'll take a look at the technical problems.
Comment 48 Katrin Fischer 2024-04-26 14:42:15 UTC
(In reply to Caroline Cyr La Rose from comment #46)
> (In reply to Katrin Fischer from comment #44)
> > I am not sure about the proposed patches here as what they actually do and
> > what is advertised in the bug title doesn't match up.
> > 
> > 1) This changes the current behavior beyond not displaying $h: 
> > 
> > We won't be displaying any "Online resources" info if there isn't a $u. The
> > LOC documentation lists a few examüles where we don't have a $u:
> > 
> > https://www.loc.gov/marc/bibliographic/bd856.html
> > 
> > 856 	1#$amaine.maine.edu$cMust be decompressed with PKUNZIP$fresource.zip
> > 856 	0#$akentvm.bitnet$facadlist file1$facadlist file2$facadlist file3
> > 856 	0#$auicvm.bitnet$fAN2
> > 856 	2#$amadlab.sprl.umich.edu$p3000
> > 856 	10$zFTP access to PostScript version includes groups of article files
> > with .pdf
> > extension$aftp.cdc.gov$d/pub/EIS/vol*no*/adobe$f*.pdf$qapplication/pdf 
> > 
> > So are we sure there are no unintended side effects of this change?
> > 
> 
> I can't really answer the more technical questions, I will leave this to
> Matthias, but I can answer this one. Currently, there is a link "Click here
> to access online" whether there is a $u or not and the href is the contents
> of the $u. That is definitely not wanted, I don't think. If anyone currently
> uses the 856 field without $u, they must have display problems. 
> I think the 856$u alternative in MARC is to use a combination of $a, $d, and
> $f. Those subfields are currently not supported in the XSLT.  
> I don't really see how we could introduce a regression if the current
> behaviour is broken and the alternative behaviour is not implemented.
> 
> You're right that it kind of veered off from the title of the bug. It
> started with my issue with 856$h, but as Matthias looked at the code, we
> noticed that only $3, $u, $y and $z were implemented in the display, with
> the $u as the href and it was displayed if there is any 856 subfield. Since
> the link depends on the $u, I instructed him to hide the whole thing if
> there is no $u. I will change the bug's title to reflect more the current
> behaviour.
> 
> If we want to implement $a/$d/$f for those who use it, I think it should be
> done in the context of another bug.

All good points :)

I didn't have the time to dig deeper than checking if it could be a valid use case to have an 856 without $u. So I put the question out there. 

I am ok with relying on $u for now, but:

* Could we maybe adjust bug description and release notes to reflect the slightly different route we've taken?
* When making the comments 2)-5) I assumed we would take this route, so they should still be valid. Would be great to get some feedback/follow-ups on those. :)
Comment 49 Matthias Le Gac 2024-04-26 18:29:49 UTC
Created attachment 165688 [details] [review]
Bug 36111: online resource link should be based on the presence of 856
Comment 50 Matthias Le Gac 2024-04-26 18:33:53 UTC
Compared to the proposed enhancement, I've changed to loop only on the 856 that have the u field, and that way I've removed the if u that were overloading. 
However, I still left the first if u before the loop because otherwise it would leave an empty div which would modify the display space.

Caroline changed the task title and description to be more consistent.
Comment 51 David Nind 2024-04-28 19:17:38 UTC
Created attachment 165709 [details] [review]
Bug 36111: 856$h should not appear as a link in detailed record

Test plan:
1. Add 856$h to MARC editor
   1.1. Go to Administration > MARC bibliographic frameworks
   1.2. Next to Default framework, click Actions > MARC structure
   1.3. Search for field 856
   1.4. Click Actions > Edit subfields
   1.5. Click h
   1.6. Check the Editor box
   1.7. Click Save changes
2. Catalog a new record with a random URL in 856$h
   2.1. Go to Cataloging
   2.2. Click New record
   2.3. Fill out the mandatory fields (000, 003, 005, 008, 040$c,
        245$a, 942$c)
   2.4. Go to tab 8 and enter a value in 856$h
   2.5. Click Save (No need to add an item)
3. Search for the title in the staff interface (a large enough
   search to have more than one result)
   --> Notice it says "Online resources: Click here to access online"
   3.1. Try to click the link
        --> Blank page
4. Access the detailed record in the staff interface
   --> Notice it says "Online resources: Click here to access online"
   4.1. Try to click the link
        --> Blank page
5. Search for the title in the opac (a large enough search to have
   more than one result)
   --> Notice it says "Online resources: Click here to access online"
   5.1. Try to click the link
        --> Blank page
6. Access the detailed record in the opac
   --> Notice it says "Online resources: Click here to access online"
   6.1. Try to click the link
        --> Blank page
7. Edit the item and add a text in field 856$y
8. Access the detailed record in the staff interface
   --> Notice it says what you put in 856$y field
9. Apply the patch
10. Replay steps 3 through 6, but this time, the "Online resources"
   field should not be present.
11. Replay steps 7 through 8, but this time, what you put in 856$y
   field should not be present.
12. Edit the item and add a url in field 856$u
13. Replay steps 3 through 6, but this time, clicking on the link
    should take you to the URL specified in the 856$u field.
14. Replay steps 7 through 8, but this time, what you put in 856$y
   field should be present and
   clicking on the link should take you to the URL specified in the 856$u field.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 52 David Nind 2024-04-28 19:17:42 UTC
Created attachment 165710 [details] [review]
Bug 36111: fixed extra space

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Comment 53 David Nind 2024-04-28 19:17:45 UTC
Created attachment 165711 [details] [review]
Bug 36111: online resource link should be based on the presence of 856

Signed-off-by: David Nind <david@davidnind.com>
Comment 54 David Nind 2024-04-28 19:51:28 UTC
Testing notes (using KTD):

1. Edited the Books framework to make 856$h visible in the editor
2. Edited Programming Perl (biblionumber=262) to add two entries:
   Entry 1:
   . 856$h = https://example.com
   . 856$y = Non-functioning URL
   Entry 2:
   . 856$u = https://example.com
   . 856$y = Functioning URL
3. Before the patch, clicking on the non-functional URL link opens a blank page. The staff interface and OPAC search result and detail pages all display:
     Online resources: Non-functioning URL | Functioning URL
4. After the patch:
   4.1 The non-functioning URL is no longer displayed:
         Online resources: Functioning URL
   4.2 If there is only one 856 entry AND it has an $h, then 'Online resources' information is no longer displayed in any of the search result or detail pages. (As expected.)
   4.3 If a single entry has both an 856$h and an 856$y, it is not displayed. (As expected.) (My reading of the 856 information indicates you shouldn't do this. That is, every URL (whether $h or $u) should have a separate 856 entry.)
   4.4 If there is a $u and no $y subfield, then the text displayed in the search result and detail pages is:
         Online resources: Click here to access online