From 5187bd52b9b141426a22fc55bfbbe54ba77e6ce2 Mon Sep 17 00:00:00 2001 From: Jake Deery Date: Wed, 25 Mar 2026 14:24:30 +0000 Subject: [PATCH] Bug 42175: Fix Mojo under k.t.d This patch fixes Mojo under k.t.d by providing CGI::Compile with an absolute rather than relative path. TO TEST: == APPLY PATCH == a) run reset_all b) run apachectl stop (if apache does not stop, may need to `sudo kill -9 apache2`) c) run /kohadevbox/koha/bin/opac prefork -m production -p -l http://*:8080 & c) run /kohadevbox/koha/bin/intranet prefork -m production -p -l http://*:8081 & d) confirm you can use k.t.d. as normal == SIGN OFF == Signed-off-by: Eric Phetteplace Signed-off-by: David Cook Signed-off-by: Lucas Gass --- Koha/App/Controller/CGI.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Koha/App/Controller/CGI.pm b/Koha/App/Controller/CGI.pm index 4df328527d..d5e52459c0 100644 --- a/Koha/App/Controller/CGI.pm +++ b/Koha/App/Controller/CGI.pm @@ -80,9 +80,10 @@ sub _render_script { return $c->reply->not_found; } - my $sub = CGI::Compile->compile($script); - my $app = CGI::Emulate::PSGI->handler($sub); - my $response = $app->( $c->_psgi_env() ); + my $abs_script = $c->app->home->rel_file($script); + my $sub = CGI::Compile->compile($abs_script); + my $app = CGI::Emulate::PSGI->handler($sub); + my $response = $app->( $c->_psgi_env() ); $c->res->code( $response->[0] ); $c->res->headers->from_hash( { @{ $response->[1] } } );