Bug 35408 - ERM > Titles > Import from a list gives an invalid link to the import job
Summary: ERM > Titles > Import from a list gives an invalid link to the import job
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: ERM (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact:
URL:
Keywords:
Depends on: 32030
Blocks:
  Show dependency treegraph
 
Reported: 2023-11-27 22:43 UTC by Victor Grousset/tuxayo
Modified: 2023-12-14 21:09 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00,23.11.01,23.05.07


Attachments
Bug 35408: Fix import job link (2.92 KB, patch)
2023-11-28 08:18 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 35408: Fix import job link (2.99 KB, patch)
2023-11-28 17:29 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 35408: Fix import job link (3.03 KB, patch)
2023-11-29 20:04 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Grousset/tuxayo 2023-11-27 22:43:10 UTC
Test plan

1. enable ERMModule syspref
2. create a new list and add one or more records to it
4. go to eHoldings > Local > Titles > Import from a list
5. start import
6. click on the link to job
7. 404 :o


link is 
http://localhost:8081/cgi-bin/koha/admin/background_jobs/1
instead of 
http://localhost:8081/cgi-bin/koha/admin/background_jobs.pl?op=view&id=1

It happened to me once, then I tried to reproduce and the link was correct...
And now it happened again. No idea how to make it consistent.
Comment 1 Jonathan Druart 2023-11-28 08:18:50 UTC
Created attachment 159284 [details] [review]
Bug 35408: Fix import job link

After importing titles from a list there is a link to the background job
that is displayed.
This link points to /cgi-bin/koha/admin/background_jobs/:id
There is a route to this path in routes/erm.js, to redirect to the
correct URI /cgi-bin/koha/admin/background_jobs.pl?op=view&id=:id
However this link will not work if we are accessing it from outside the
ERM app/module, or if we are opening it in a new tab/window.

The idea was interesting, but does not work...

Test plan:
Create a new ERM local package, a new list (virtual shelf), add some
items to the list.
Go to E-resource management > eHoldings > Local > Titles > Import from a list
Click "import"
Notice the "see job" link and click it

=> Confirm that with this patch applied you can open it in a new tab
without getting a 404
Comment 2 Matt Blenkinsop 2023-11-28 17:29:15 UTC
Created attachment 159309 [details] [review]
Bug 35408: Fix import job link

After importing titles from a list there is a link to the background job
that is displayed.
This link points to /cgi-bin/koha/admin/background_jobs/:id
There is a route to this path in routes/erm.js, to redirect to the
correct URI /cgi-bin/koha/admin/background_jobs.pl?op=view&id=:id
However this link will not work if we are accessing it from outside the
ERM app/module, or if we are opening it in a new tab/window.

The idea was interesting, but does not work...

Test plan:
Create a new ERM local package, a new list (virtual shelf), add some
items to the list.
Go to E-resource management > eHoldings > Local > Titles > Import from a list
Click "import"
Notice the "see job" link and click it

=> Confirm that with this patch applied you can open it in a new tab
without getting a 404

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Comment 3 Victor Grousset/tuxayo 2023-11-29 20:04:15 UTC
Created attachment 159371 [details] [review]
Bug 35408: Fix import job link

After importing titles from a list there is a link to the background job
that is displayed.
This link points to /cgi-bin/koha/admin/background_jobs/:id
There is a route to this path in routes/erm.js, to redirect to the
correct URI /cgi-bin/koha/admin/background_jobs.pl?op=view&id=:id
However this link will not work if we are accessing it from outside the
ERM app/module, or if we are opening it in a new tab/window.

The idea was interesting, but does not work...

Test plan:
Create a new ERM local package, a new list (virtual shelf), add some
items to the list.
Go to E-resource management > eHoldings > Local > Titles > Import from a list
Click "import"
Notice the "see job" link and click it

=> Confirm that with this patch applied you can open it in a new tab
without getting a 404

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 4 Victor Grousset/tuxayo 2023-11-29 20:06:41 UTC
> There is a route to this path in routes/erm.js, to redirect to the
> correct URI /cgi-bin/koha/admin/background_jobs.pl?op=view&id=:id
> However this link will not work if we are accessing it from outside the
> ERM app/module, or if we are opening it in a new tab/window.

I would have never guess it was new tab vs normal click. Thanks a lot Jonathan :)

Works, makes sense, QA script happy, code looks good, passing QA :)
Comment 5 Katrin Fischer 2023-12-11 18:47:02 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 6 Fridolin Somers 2023-12-12 07:32:57 UTC
Pushed to 23.11.x for 23.11.01
Comment 7 Lucas Gass 2023-12-14 21:09:52 UTC
Backported to 23.05.x for upcoming 23.05.07