Bug 29498: Remove usage of deprecated Mojolicious::Routes::Route::detour
authorJulian Maurice <julian.maurice@biblibre.com>
Tue, 16 Nov 2021 15:31:02 +0000 (15:31 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 19 Jan 2022 07:15:04 +0000 (21:15 -1000)
commit40da37caa66840280f421d994e56ecdf6eb446cf
tree7274b06611bb880c803c6f81a05496dc9bef4b74
parentc96fee3840ca68508ced69ca9db990cefe2a8c41
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>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Koha/App/Plugin/RESTV1.pm