Bug 29498 - Remove usage of deprecated Mojolicious::Routes::Route::detour
Summary: Remove usage of deprecated Mojolicious::Routes::Route::detour
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Julian Maurice
QA Contact: Tomás Cohen Arazi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-17 06:18 UTC by Julian Maurice
Modified: 2022-02-11 18:22 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00,21.11.03


Attachments
Bug 29498: Remove usage of deprecated Mojolicious::Routes::Route::detour (1.47 KB, patch)
2021-11-17 06:19 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 29498: Remove usage of deprecated Mojolicious::Routes::Route::detour (1.53 KB, patch)
2021-12-17 15:04 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Maurice 2021-11-17 06:18:25 UTC
Mojolicious::Routes::Route::detour was deprecated in Mojolicious 8.67 and removed in Mojolicious 9

The method is used in Koha::App::Plugin::RESTV1 to connect the "REST API" Mojolicious app to the other Mojolicious apps (Koha::App::Intranet and Koha::App::Opac), so it's only a problem when running Koha as a Mojolicious app.
Comment 1 Julian Maurice 2021-11-17 06:19:12 UTC
Created attachment 127705 [details] [review]
Bug 29498: Remove usage of deprecated Mojolicious::Routes::Route::detour

Mojolicious::Routes::Route::detour was deprecated in Mojolicious 8.67
and removed in Mojolicious 9

It was used in Koha::App::Plugin::RESTV1 to connect the "REST API"
Mojolicious app to the other Mojolicious apps (Koha::App::Intranet and
Koha::App::Opac), so it's only a problem when running Koha as a
Mojolicious app.

This patch makes use of the "partial" attribute instead, which does the
same thing.

Test plan:
1. Run `morbo bin/intranet`
2. Point your browser to what morbo says (should be localhost:3000)
3. Log in, and go to Administration » Libraries. This table uses the
   REST API, so if you see data in it, that means the API (and the
   patch) works
Comment 2 Tomás Cohen Arazi 2021-12-17 15:04:25 UTC
Created attachment 128676 [details] [review]
Bug 29498: Remove usage of deprecated Mojolicious::Routes::Route::detour

Mojolicious::Routes::Route::detour was deprecated in Mojolicious 8.67
and removed in Mojolicious 9

It was used in Koha::App::Plugin::RESTV1 to connect the "REST API"
Mojolicious app to the other Mojolicious apps (Koha::App::Intranet and
Koha::App::Opac), so it's only a problem when running Koha as a
Mojolicious app.

This patch makes use of the "partial" attribute instead, which does the
same thing.

Test plan:
1. Run `morbo bin/intranet`
2. Point your browser to what morbo says (should be localhost:3000)
3. Log in, and go to Administration » Libraries. This table uses the
   REST API, so if you see data in it, that means the API (and the
   patch) works

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 3 Tomás Cohen Arazi 2021-12-17 15:09:22 UTC
Trivial change that prepares the ground for upgrading Mojolicious (in the works).
Works as expected, passes the QA checks.

Straight QA as it will hardly find a good soul to QA it sooner than later.
Comment 4 Fridolin Somers 2022-01-06 06:12:39 UTC
Maybe we need a new component for Koha as a Mojolicious app.
Comment 5 Fridolin Somers 2022-01-19 07:20:56 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 6 Kyle M Hall 2022-02-04 19:20:22 UTC
Pushed to 21.11.x for 21.11.03
Comment 7 Andrew Fuerste-Henry 2022-02-11 18:22:31 UTC
Not backporting to 21.05, please ask if needed.