Bug 33314

Summary: Link to bibliographic record incomplete in default TICKET_NOTIFY notice
Product: Koha Reporter: Caroline Cyr La Rose <caroline.cyr-la-rose>
Component: NoticesAssignee: Katrin Fischer <katrin.fischer>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: david, jonathan.druart, martin.renvoize, matt.blenkinsop
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33313
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33315
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00
Bug Depends on: 33313    
Bug Blocks:    
Attachments: Bug 33314: Fix link into staff catalog and link text
Bug 33314: Fix link into staff catalog and link text
Bug 33314: Fix link into staff catalog and link text

Description Caroline Cyr La Rose 2023-03-22 18:54:49 UTC
When reporting a catalog concern, an email is sent to the cataloging team with a link to the bibliographic record in question. However, this link seems to be incomplete. (Might be linked to bug 33313, but I think the source of the problem is different...)

To reproduce:
1. Make sure staffClientBaseURL is filled correctly
2. Enable CatalogConcerns
3. Enter an email address in CatalogerEmails
4. Go to a bibliographic record in the staff interface
5. Click New > New catalog concern
6. Fill out the form and click Submit
7. Check the message_queue table for the message
   --> In the message, the link base to the record is empty
   a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=61"

Unfortunately, it's not as easy as changing the pref name to staffClientBaseURL because the line in the notice is [%- INCLUDE 'biblio-title.inc' biblio=ticket.biblio link = 1 -%]. So I'm guessing it's taking the baseURL somewhere else, but I don't know where.
Comment 1 Katrin Fischer 2023-04-23 20:37:19 UTC
I believe using the link here won't work as it is building a link for use inside of Koha - so missing the base URL part. It's not made for use in a notice.
Comment 2 Katrin Fischer 2023-04-23 20:58:28 UTC
Created attachment 150136 [details] [review]
Bug 33314: Fix link into staff catalog and link text

Both fixes concern the TICKET_NOTIFY message.

* biblio-title.inc builds a link with the intention
  of using it inside the Koha GUI. Therefore the baseURL part
  is missing. But we can use it for display and wrap it into
  a link.
* Changes second link from reading 'page' to 'concern management
  page'. Accessiblity guidelines teach us that you should not link
  general terms, but always be specific.

To test:
1. Make sure staffClientBaseURL is filled correctly
2. Enable CatalogConcerns
3. Enter an email address in CatalogerEmails
4. Go to a bibliographic record in the staff interface or in the OPAC
5. Click New > New catalog concern
6. Fill out the form and click Submit
7. Check the message_queue table for the message
8. Verify the first link is not working (incomplete) and the second is 'page'
9. Apply patch, drop db, create db and run web installer
10. Repeat setup and testing
11. Both links should now be updated and working
Comment 3 David Nind 2023-04-23 23:13:38 UTC
Created attachment 150144 [details] [review]
Bug 33314: Fix link into staff catalog and link text

Both fixes concern the TICKET_NOTIFY message.

* biblio-title.inc builds a link with the intention
  of using it inside the Koha GUI. Therefore the baseURL part
  is missing. But we can use it for display and wrap it into
  a link.
* Changes second link from reading 'page' to 'concern management
  page'. Accessiblity guidelines teach us that you should not link
  general terms, but always be specific.

To test:
1. Make sure staffClientBaseURL is filled correctly
2. Enable CatalogConcerns
3. Enter an email address in CatalogerEmails
4. Go to a bibliographic record in the staff interface or in the OPAC
5. Click New > New catalog concern
6. Fill out the form and click Submit
7. Check the message_queue table for the message
8. Verify the first link is not working (incomplete) and the second is 'page'
9. Apply patch, drop db, create db and run web installer
10. Repeat setup and testing
11. Both links should now be updated and working

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2023-04-23 23:16:39 UTC
Testing notes (using KTD):

1. When applying the patch, DON'T follow 31028 (the main patch is pushed to master, some follow-up patches have not yet been pushed).

2. After applying the patch, reset_all refreshes everything with the updated notice (step 9). 

3. I set up email to test the actual emails received.[1]

[1] To test sending emails using a Google account, edit /etc/koha/sites/kohadev/koha-conf.xml file and add this configuration near the end (where <user_name> = your Google email address; <password> = your APP password, not your Google account password):

 <smtp_server>
    <host>smtp.gmail.com</host>
    <port>587</port>
    <timeout>5</timeout>
    <ssl_mode>STARTTLS</ssl_mode>
    <user_name>GOOGLEACCOUNTUSER</user_name>
    <password>GOOGLEAPPPASSWORD</password>
    <debug>1</debug>
 </smtp_server>
Comment 5 Jonathan Druart 2023-05-03 09:57:37 UTC
Blocked by bug 33313.
Comment 6 Martin Renvoize 2023-05-18 13:34:07 UTC
Created attachment 151418 [details] [review]
Bug 33314: Fix link into staff catalog and link text

Both fixes concern the TICKET_NOTIFY message.

* biblio-title.inc builds a link with the intention
  of using it inside the Koha GUI. Therefore the baseURL part
  is missing. But we can use it for display and wrap it into
  a link.
* Changes second link from reading 'page' to 'concern management
  page'. Accessiblity guidelines teach us that you should not link
  general terms, but always be specific.

To test:
1. Make sure staffClientBaseURL is filled correctly
2. Enable CatalogConcerns
3. Enter an email address in CatalogerEmails
4. Go to a bibliographic record in the staff interface or in the OPAC
5. Click New > New catalog concern
6. Fill out the form and click Submit
7. Check the message_queue table for the message
8. Verify the first link is not working (incomplete) and the second is 'page'
9. Apply patch, drop db, create db and run web installer
10. Repeat setup and testing
11. Both links should now be updated and working

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2023-05-18 13:34:32 UTC
Nice work Katrin, thank you very much for these fixes!

Passing QA
Comment 8 Tomás Cohen Arazi 2023-05-18 14:04:36 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 9 Matt Blenkinsop 2023-06-12 10:08:41 UTC
Missing dependencies - not backporting to 22.11.x