[Koha-devel] Mojolicious controllers for Koha plugins

dcook at prosentient.com.au dcook at prosentient.com.au
Wed Aug 17 08:29:23 CEST 2022


Thanks, Kyle!

 

I’ll look at updating the patches from Bug 28325 and post new work for this at https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380  

 

David Cook

Senior Software Engineer

Prosentient Systems

Suite 7.03

6a Glen St

Milsons Point NSW 2061

Australia

 

Office: 02 9212 0899

Online: 02 8005 0595

 

From: Kyle Hall <kyle at bywatersolutions.com> 
Sent: Tuesday, 16 August 2022 9:27 PM
To: dcook at prosentient.com.au
Cc: koha-devel at lists.koha-community.org; Tomas Cohen Arazi <tomascohen at theke.io>; Renvoize, Martin <martin.renvoize at ptfs-europe.com>
Subject: Re: Mojolicious controllers for Koha plugins

 

That sounds great to me David! I'll 100% assist you with testing and qa!

 

On Tue, Aug 16, 2022 at 3:42 AM <dcook at prosentient.com.au <mailto:dcook at prosentient.com.au> > wrote:

Hi all,

 

I was just writing a Koha plugin to do a big data export, but I realize that it’s probably going to timeout, because Koha plugins run under Plack::App::CGIBin which buffers the entire response before it returns it to Apache to return to the client browser. It’s the reason Koha uses CGI instead of Plack for export.pl <http://export.pl> 

 

While we can use Mojolicious controllers with Koha plugins when it adds REST API endpoints, we can’t do that for Koha plugins themselves. 

 

This is a topic that I’ve touched on before, and there are challenges when it comes to Authentication and Templates, but they’re solvable challenges:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26791 “Build Mojolicious controller replacement for export.pl <http://export.pl> ”

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28325 “Build Mojolicious controller replacement for tools-home.pl <http://tools-home.pl> ”

 

We could just start by supporting “tool” and “report” with the Mojolicious controllers, and that would just mean plugins-home.pl <http://plugins-home.pl>  detecting that there is Mojolicious support in that plugin, and then building a URL to “/staff/plugins/run” instead of “/cgi-bin/koha/plugins/run.pl <http://run.pl> ” for instance.

 

That Mojolicious controller would really just need to check authentication/authorization, which is very doable with a fairly minor refactor. 

 

If I could get the support of just a couple other people, I’d be happy to do a lot of the authoring (or testing or whatever needs to be done just to get it done).

 

By using Mojolicious controllers for select plugins, we’d also be able to shake out any issues without causing any regressions in core Koha, and then hopefully be able to start refactoring core Koha too…

 

Anyways, please give it some consideration, and ask me if you have any questions. 

 

I’ll be looking more into export problems tomorrow, so I might end up going a different route for the sake of time in the short-term, but I think we should still be looking at shifting away from CGI and Plack::App::CGIBin due to their limitations…

 

David Cook

Senior Software Engineer

Prosentient Systems

Suite 7.03

6a Glen St

Milsons Point NSW 2061

Australia

 

Office: 02 9212 0899

Online: 02 8005 0595

 



-- 

Kyle M. Hall

Loose Cannon, ByWater Solutions

 <mailto:kyle at bywatersolutions.com> kyle at bywatersolutions.com
 <http://bywatersolutions.com/> https://bywatersolutions.com

 <http://bywatersolutions.com/what-is-koha/> What is Koha?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20220817/726b7bd7/attachment.htm>


More information about the Koha-devel mailing list