[Koha-bugs] [Bug 31380] Build Mojolicious controller for running Koha plugins

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Nov 7 03:21:35 CET 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380

David Cook <dcook at prosentient.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #144969|0                           |1
        is obsolete|                            |

--- Comment #50 from David Cook <dcook at prosentient.com.au> ---
Created attachment 158583
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158583&action=edit
Bug 31380: Allow Koha Plugins to run using Mojolicious controllers

This patch adds a new mount point in plack.psgi, which makes Koha
able to run Mojolicious controllers. For example:
http://localhost:8081/cgi-bin/koha/staff/plugins/run

0a) Apply patch
0b) cp debian/templates/plack.psgi /etc/koha/sites/kohadev/plack.psgi
0c) koha-plack --restart kohadev
1) Upload Koha Plugin koha-plugin-mojolicious.kpz
2) koha-plack --restart kohadev
3) Go to
http://localhost:8081/cgi-bin/koha/plugins/plugins-home.pl
4) Next to "Mojolicious Test", click "Actions", then click "Run tool"
5) Note that the web page looks perfect
6) Note that the URL is a bit different to normal:
http://localhost:8081/cgi-bin/koha/staff/plugins/run?class=Koha%3A%3APlugin%3A%3AProsentient%3A%3AMojolicious&method=tool
instead of:
http://localhost:8081/cgi-bin/koha/plugins/run.pl?class=Koha%3A%3APlugin%3A%3AProsentient%3A%3AMojolicious&method=tool

Note: The test Koha plugin will only work with a Mojolicious controller,
but it could be easily made to work with both

7) Run the above test using an unauthenticated user,
use a staff user without plugin permissions, try with a staff
user with plugin permissions, and try with a superlibrarian

8) Run tests
prove t/db_dependent/Koha/Auth.t
prove t/db_dependent/Koha/Mojo/Plugins/Core.t
prove t/db_dependent/Koha/Template.t

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list