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>
This commit is contained in:
Julian Maurice 2021-11-16 15:31:02 +00:00 committed by Fridolin Somers
parent c96fee3840
commit 40da37caa6
1 changed files with 1 additions and 1 deletions

View File

@ -26,7 +26,7 @@ use Koha::REST::V1;
sub register {
my ($self, $app) = @_;
$app->routes->any('/api')->detour(app => Koha::REST::V1->new);
$app->routes->any('/api')->partial(1)->to(app => Koha::REST::V1->new);
}
1;