Bug 34052

Summary: Fix link to subscription from serial collection page
Product: Koha Reporter: David Cook <dcook>
Component: SerialsAssignee: David Cook <dcook>
Status: RESOLVED FIXED QA Contact: Katrin Fischer <katrin.fischer>
Severity: minor    
Priority: P5 - low Keywords: Academy
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00,23.05.02,22.11.08
Circulation function:
Attachments: Bug 34052: Use root relative URL for subscription-detail.pl
Bug 34052: Use root relative URL for subscription-detail.pl
Bug 34052: Use root relative URL for subscription-detail.pl
Bug 34052: Use root relative URL for subscription-detail.pl

Description David Cook 2023-06-19 03:48:28 UTC
On the serials-collection.pl page, there is a same-directory relative link to "subscription-detail.pl" under the "Subscription num." column.

Most of the time this isn't a problem, but when you delete a serial, it sends you to a URL like this:

http://localhost:8081/cgi-bin/koha/serials/serials-collection.pl/?op=delete_confirmed&biblionumber=1&subscriptionid=1&serialid=1#

That relative URL will be interpreted as the following:

http://localhost:8081/cgi-bin/koha/serials/serials-collection.pl/subscription-detail.pl?subscriptionid=1

Instead of generating an error, this actually loads the http://localhost:8081/cgi-bin/koha/serials/serials-collection.pl page. The /subscription-detail.pl would be just added to the PATH_INFO on the server. 

The solution is to use a root-relative URL like we do everywhere else (e.g. /cgi-bin/koha/serials/subscription-detail.pl)
Comment 1 David Cook 2023-06-19 04:33:11 UTC
Created attachment 152459 [details] [review]
Bug 34052: Use root relative URL for subscription-detail.pl

This patch replaces a same directory relative URL with a root
relative URL, so that the navigation to subscription-detail.pl
works correctly after deleting a serial.

To test:
0. Apply patch
1. Go to http://localhost:8081/cgi-bin/koha/serials/serials-home.pl
2. Click "New subscription"
3. Click "Search for a vendor"
4. Click "OK"
5. Click "Choose"
6. Click "Search for record"
7. Type "e" into "Keyword:" box
8. Click "Search"
9. Click "Choose" on top result
10. Click "Next"
11. Fill in "Serials planning" however you like, and click
"Test prediction pattern"
12. Click "Save subscription"
13. Click "Serial collection" in left nav menu
14. Click "Delete selected issues"
15. Click "Yes, delete"
16. Click the link under the "Subscription num." table column
17. Note that you're taken to the subscription detail page
Comment 2 Sam Lau 2023-06-20 18:03:31 UTC
Created attachment 152493 [details] [review]
Bug 34052: Use root relative URL for subscription-detail.pl

This patch replaces a same directory relative URL with a root
relative URL, so that the navigation to subscription-detail.pl
works correctly after deleting a serial.

To test:
0. Apply patch
1. Go to http://localhost:8081/cgi-bin/koha/serials/serials-home.pl
2. Click "New subscription"
3. Click "Search for a vendor"
4. Click "OK"
5. Click "Choose"
6. Click "Search for record"
7. Type "e" into "Keyword:" box
8. Click "Search"
9. Click "Choose" on top result
10. Click "Next"
11. Fill in "Serials planning" however you like, and click
"Test prediction pattern"
12. Click "Save subscription"
13. Click "Serial collection" in left nav menu
14. Click "Delete selected issues"
15. Click "Yes, delete"
16. Click the link under the "Subscription num." table column
17. Note that you're taken to the subscription detail page

Signed-off-by: Sam Lau <samalau@gmail.com>
Comment 3 Katrin Fischer 2023-06-22 20:29:50 UTC
Created attachment 152591 [details] [review]
Bug 34052: Use root relative URL for subscription-detail.pl

This patch replaces a same directory relative URL with a root
relative URL, so that the navigation to subscription-detail.pl
works correctly after deleting a serial.

To test:
0. Apply patch
1. Go to http://localhost:8081/cgi-bin/koha/serials/serials-home.pl
2. Click "New subscription"
3. Click "Search for a vendor"
4. Click "OK"
5. Click "Choose"
6. Click "Search for record"
7. Type "e" into "Keyword:" box
8. Click "Search"
9. Click "Choose" on top result
10. Click "Next"
11. Fill in "Serials planning" however you like, and click
"Test prediction pattern"
12. Click "Save subscription"
13. Click "Serial collection" in left nav menu
14. Click "Delete selected issues"
15. Click "Yes, delete"
16. Click the link under the "Subscription num." table column
17. Note that you're taken to the subscription detail page

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Katrin Fischer 2023-06-22 20:31:30 UTC
Technically the bug description was correct, but I think we can make it a little more telling to users :)
Comment 5 Katrin Fischer 2023-06-22 20:33:54 UTC
Created attachment 152592 [details] [review]
Bug 34052: Use root relative URL for subscription-detail.pl

This patch replaces a same directory relative URL with a root
relative URL, so that the navigation to subscription-detail.pl
works correctly after deleting a serial.

To test:
0. Apply patch
1. Go to http://localhost:8081/cgi-bin/koha/serials/serials-home.pl
2. Click "New subscription"
3. Click "Search for a vendor"
4. Click "OK"
5. Click "Choose"
6. Click "Search for record"
7. Type "e" into "Keyword:" box
8. Click "Search"
9. Click "Choose" on top result
10. Click "Next"
11. Fill in "Serials planning" however you like, and click
"Test prediction pattern"
12. Click "Save subscription"
13. Click "Serial collection" in left nav menu
14. Click "Delete selected issues"
15. Click "Yes, delete"
16. Click the link under the "Subscription num." table column
17. Note that you're taken to the subscription detail page

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Tomás Cohen Arazi (tcohen) 2023-06-23 12:46:30 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 7 Martin Renvoize (ashimema) 2023-07-17 14:03:16 UTC
Thanks for all the hard work!

Pushed to 23.05.x for the next release
Comment 8 Pedro Amorim 2023-07-18 11:55:13 UTC
Nice work everyone!

Pushed to 22.11.x for next release