[Bug 31380] New: Build Mojolicious controller for running Koha plugins
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 Bug ID: 31380 Summary: Build Mojolicious controller for running Koha plugins Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: dcook@prosentient.com.au QA Contact: testopia@bugs.koha-community.org At the moment, Koha plugins run via Plack::App::CGIBin, which buffers responses and otherwise prevents plugins from fully leveraging the power of Plack and Mojolicious. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |dcook@prosentient.com.au |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=28325, | |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=26791 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |31389 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31389 [Bug 31389] Calculate user permissions in separate function -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=27293 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 --- Comment #1 from David Cook <dcook@prosentient.com.au> --- Created attachment 139308 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139308&action=edit Bug 31380: Build core functionality for 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 1) Upload Koha Plugin koha-plugin-mojolicious.kpz 2) koha-plack --restart 3) Go to http://localhost:8081/cgi-bin/koha/staff/plugins/run?class=Koha%3A%3APlugin%3A%3AProsentient%3A%3AMojolicious&method=tool 4) Note that it looks perfect 5) The following URL will generate a 500 error, but technically the Koha Plugin could easily be crafted to support both CGI and Mojolicious::Controller objects: http://localhost:8081/cgi-bin/koha/plugins/run.pl?class=Koha%3A%3APlugin%3A%3AProsentient%3A%3AMojolicious&method=tool -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 --- Comment #2 from David Cook <dcook@prosentient.com.au> --- Created attachment 139309 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139309&action=edit Koha Plugin with Mojolicious controller -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also|https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=27293 | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |31390 --- Comment #3 from David Cook <dcook@prosentient.com.au> --- The Koha::Auth class contains a function which should use Bug 31389 instead, so that will be my next thing to do. Currently, the Koha::Template class generates the following warnings: [2022/08/18 00:55:50] [WARN] no query in gettemplate at /kohadevbox/koha/C4/Templates.pm line 216. [2022/08/18 00:55:50] [WARN] no query in themelanguage at /kohadevbox/koha/C4/Templates.pm line 276. [2022/08/18 00:55:50] [WARN] no query in themelanguage at /kohadevbox/koha/C4/Templates.pm line 276. Bug 31390 should take care of those warnings though. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31390 [Bug 31390] Remove noisy warns in C4::Templates -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 --- Comment #4 from David Cook <dcook@prosentient.com.au> --- Created attachment 139312 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139312&action=edit Bug 31380: Add plugin hook for choosing Mojolicious or CGI script controller This change checks for a "use_mojolicious" method in the plugin in order to determine whether it should use a Mojolicious controller or a CGI script controller. Note that the check is for the existence of the method, so it is backwards compatible with all existing Koha Plugins. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 --- Comment #5 from David Cook <dcook@prosentient.com.au> --- Created attachment 139313 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139313&action=edit Koha Plugin with Mojolicious controller -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139309|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 --- Comment #6 from David Cook <dcook@prosentient.com.au> --- I think that this is ready for sign off. Let me know if you have any additional feedback, and I can keep working on it. Otherwise, I'd consider this done! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139308|0 |1 is obsolete| | --- Comment #7 from David Cook <dcook@prosentient.com.au> --- Created attachment 139314 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139314&action=edit Bug 31380: Build core functionality for 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 1) Upload Koha Plugin koha-plugin-mojolicious.kpz 2) koha-plack --restart 3) Go to http://localhost:8081/cgi-bin/koha/staff/plugins/run?class=Koha%3A%3APlugin%3A%3AProsentient%3A%3AMojolicious&method=tool 4) Note that it looks perfect 5) The following URL will generate a 500 error, but technically the Koha Plugin could easily be crafted to support both CGI and Mojolicious::Controller objects: http://localhost:8081/cgi-bin/koha/plugins/run.pl?class=Koha%3A%3APlugin%3A%3AProsentient%3A%3AMojolicious&method=tool -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139312|0 |1 is obsolete| | --- Comment #8 from David Cook <dcook@prosentient.com.au> --- Created attachment 139315 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139315&action=edit Bug 31380: Add plugin hook for choosing Mojolicious or CGI script controller This change checks for a "use_mojolicious" method in the plugin in order to determine whether it should use a Mojolicious controller or a CGI script controller. Note that the check is for the existence of the method, so it is backwards compatible with all existing Koha Plugins. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139314|0 |1 is obsolete| | --- Comment #9 from David Cook <dcook@prosentient.com.au> --- Created attachment 139316 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139316&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 1) Upload Koha Plugin koha-plugin-mojolicious.kpz 2) koha-plack --restart 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139315|0 |1 is obsolete| | --- Comment #10 from David Cook <dcook@prosentient.com.au> --- Created attachment 139317 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139317&action=edit Bug 31380: Add plugin hook for choosing Mojolicious or CGI script controller This change checks for a "use_mojolicious" method in the plugin in order to determine whether it should use a Mojolicious controller or a CGI script controller. Note that the check is for the existence of the method, so it is backwards compatible with all existing Koha Plugins. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139316|0 |1 is obsolete| | --- Comment #11 from David Cook <dcook@prosentient.com.au> --- Created attachment 139318 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139318&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 1) Upload Koha Plugin koha-plugin-mojolicious.kpz 2) koha-plack --restart 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139317|0 |1 is obsolete| | --- Comment #12 from David Cook <dcook@prosentient.com.au> --- Created attachment 139319 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139319&action=edit Bug 31380: Add plugin hook for choosing Mojolicious or CGI script controller This change checks for a "use_mojolicious" method in the plugin in order to determine whether it should use a Mojolicious controller or a CGI script controller. Note that the check is for the existence of the method, so it is backwards compatible with all existing Koha Plugins. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139318|0 |1 is obsolete| | --- Comment #13 from David Cook <dcook@prosentient.com.au> --- Created attachment 139320 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139320&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 1) Upload Koha Plugin koha-plugin-mojolicious.kpz 2) koha-plack --restart 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139319|0 |1 is obsolete| | --- Comment #14 from David Cook <dcook@prosentient.com.au> --- Created attachment 139321 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139321&action=edit Bug 31380: Add plugin hook for choosing Mojolicious or CGI script controller This change checks for a "use_mojolicious" method in the plugin in order to determine whether it should use a Mojolicious controller or a CGI script controller. Note that the check is for the existence of the method, so it is backwards compatible with all existing Koha Plugins. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139320|0 |1 is obsolete| | --- Comment #15 from David Cook <dcook@prosentient.com.au> --- Created attachment 139322 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139322&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 1) Upload Koha Plugin koha-plugin-mojolicious.kpz 2) koha-plack --restart 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139321|0 |1 is obsolete| | --- Comment #16 from David Cook <dcook@prosentient.com.au> --- Created attachment 139323 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139323&action=edit Bug 31380: Add plugin hook for choosing Mojolicious or CGI script controller This change checks for a "use_mojolicious" method in the plugin in order to determine whether it should use a Mojolicious controller or a CGI script controller. Note that the check is for the existence of the method, so it is backwards compatible with all existing Koha Plugins. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139322|0 |1 is obsolete| | --- Comment #17 from David Cook <dcook@prosentient.com.au> --- Created attachment 139324 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139324&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 1) Upload Koha Plugin koha-plugin-mojolicious.kpz 2) koha-plack --restart 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139323|0 |1 is obsolete| | --- Comment #18 from David Cook <dcook@prosentient.com.au> --- Created attachment 139325 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139325&action=edit Bug 31380: Add plugin hook for choosing Mojolicious or CGI script controller This change checks for a "use_mojolicious" method in the plugin in order to determine whether it should use a Mojolicious controller or a CGI script controller. Note that the check is for the existence of the method, so it is backwards compatible with all existing Koha Plugins. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 --- Comment #19 from David Cook <dcook@prosentient.com.au> --- I'm pretty happy with these patches. The Koha::Mojo::Staff class will evolve over time, but I think that it's more than sufficient for running Koha Plugins now. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 --- Comment #20 from David Cook <dcook@prosentient.com.au> --- Created attachment 139327 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139327&action=edit Bug 31380: Add unit tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139327|0 |1 is obsolete| | --- Comment #21 from David Cook <dcook@prosentient.com.au> --- Created attachment 139328 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139328&action=edit Bug 31380: Add unit tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139324|0 |1 is obsolete| | Attachment #139325|0 |1 is obsolete| | Attachment #139328|0 |1 is obsolete| | --- Comment #22 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 139394 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139394&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 1) Upload Koha Plugin koha-plugin-mojolicious.kpz 2) koha-plack --restart 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 Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 --- Comment #23 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 139395 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139395&action=edit Bug 31380: Add plugin hook for choosing Mojolicious or CGI script controller This change checks for a "use_mojolicious" method in the plugin in order to determine whether it should use a Mojolicious controller or a CGI script controller. Note that the check is for the existence of the method, so it is backwards compatible with all existing Koha Plugins. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 --- Comment #24 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 139396 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139396&action=edit Bug 31380: Add unit tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Medium patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=31339 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139394|0 |1 is obsolete| | --- Comment #25 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 139818 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139818&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 1) Upload Koha Plugin koha-plugin-mojolicious.kpz 2) koha-plack --restart 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 Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139395|0 |1 is obsolete| | --- Comment #26 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 139819 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139819&action=edit Bug 31380: Add plugin hook for choosing Mojolicious or CGI script controller This change checks for a "use_mojolicious" method in the plugin in order to determine whether it should use a Mojolicious controller or a CGI script controller. Note that the check is for the existence of the method, so it is backwards compatible with all existing Koha Plugins. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139396|0 |1 is obsolete| | --- Comment #27 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 139820 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139820&action=edit Bug 31380: Add unit tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paul.derscheid@lmscloud.de --- Comment #28 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Ha, meant to sign-off on all three but Kyle already did, so. Just tested it out and I love this. Great work! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 --- Comment #29 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Paul Derscheid from comment #28)
Ha, meant to sign-off on all three but Kyle already did, so. Just tested it out and I love this. Great work!
An additional signoff line only provides more evidence of testing. So never hesitate to add one :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 --- Comment #30 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- David, just glancing over but this code looks very good. Just thinking that Koha::Auth may be quite ambitiously named for now. How long will we have C4::Auth and Koha::Auth side by side? Do we actually need the 'staff' script or was it jusy easy while testing? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 --- Comment #31 from David Cook <dcook@prosentient.com.au> --- (In reply to Marcel de Rooy from comment #30)
David, just glancing over but this code looks very good.
Thanks, Marcel :)
Just thinking that Koha::Auth may be quite ambitiously named for now. How long will we have C4::Auth and Koha::Auth side by side?
Probably for a while, but Koha::Auth can be a target for any new auth work or for refactoring work. In Bug 31389, I've created Koha::Auth::Permissions, which contains a function to be used in C4::Auth. I suppose we could always use Koha::Mojo::Auth or some other Koha::Auth::* module instead of Koha::Auth.
Do we actually need the 'staff' script or was it jusy easy while testing?
The "staff" script is for non-Plack enabled Koha instances. "api/v1/app.pl" works similarly. Although, in plack.psgi, the API gets loaded by loading that file whereas I just load the Koha::Mojo::Staff module as I think that's cleaner. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 --- Comment #32 from David Cook <dcook@prosentient.com.au> --- Does anyone need anything more from me on this one? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139818|0 |1 is obsolete| | --- Comment #33 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 140673 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=140673&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 1) Upload Koha Plugin koha-plugin-mojolicious.kpz 2) koha-plack --restart 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 Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139819|0 |1 is obsolete| | --- Comment #34 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 140674 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=140674&action=edit Bug 31380: Add plugin hook for choosing Mojolicious or CGI script controller This change checks for a "use_mojolicious" method in the plugin in order to determine whether it should use a Mojolicious controller or a CGI script controller. Note that the check is for the existence of the method, so it is backwards compatible with all existing Koha Plugins. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139820|0 |1 is obsolete| | --- Comment #35 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 140675 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=140675&action=edit Bug 31380: Add unit tests Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |martin.renvoize@ptfs-europe | |.com --- Comment #36 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- This one took me a little while to wrap my head around.. probably just too many bugs on the mind. Anywho, now I have it looks great and all works as expected.. I think we'll need to carefully document it somewhere to showcase it. Tests are passing and the changes are covered nicely. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Keywords| |release-notes-needed --- Comment #37 from Tomás Cohen Arazi <tomascohen@gmail.com> --- We certainly need docs. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA --- Comment #38 from Tomás Cohen Arazi <tomascohen@gmail.com> --- I like where this is headed to. I think we need some more tests here, particularly for the 'staff_authorize' and 'prepare_template', unless I'm missing something. I noticed at first glance a subtle issue with __koha__user__ vs. __koha_user__ that is not caught by the provided tests. Otherwise this is great! It would be great (also) if you could perltidy some of this code. I usually select the code I want to tidy, and just ctrl+k ctrl+f on VScode. Please do it inline. Thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 --- Comment #39 from David Cook <dcook@prosentient.com.au> --- (In reply to Tomás Cohen Arazi from comment #38)
I think we need some more tests here, particularly for the 'staff_authorize' and 'prepare_template', unless I'm missing something. I noticed at first glance a subtle issue with __koha__user__ vs. __koha_user__ that is not caught by the provided tests.
Yep, can certainly do that, when I have some time.
It would be great (also) if you could perltidy some of this code. I usually select the code I want to tidy, and just ctrl+k ctrl+f on VScode. Please do it inline. Thanks!
What's the issue? I think it passed the QA tools, so that should've pointed out any perltidy issues? Because I'm on Windows, I need to do all my editing within the Docker container, so no VScode for me. But it looks like KTD has a ":Tidy" command in Vim, so I could use that. But this is fresh code that I thought I was writing in accordance with the Koha Coding Guidelines? Do we need to update those or am I just out of date? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 Bug 31380 depends on bug 31390, which changed state. Bug 31390 Summary: Remove noisy warns in C4::Templates https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31390 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 Bug 31380 depends on bug 31389, which changed state. Bug 31389 Summary: Calculate user permissions in separate function https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31389 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 --- Comment #40 from David Cook <dcook@prosentient.com.au> --- (In reply to Tomás Cohen Arazi from comment #38)
I think we need some more tests here, particularly for the 'staff_authorize' and 'prepare_template', unless I'm missing something. I noticed at first glance a subtle issue with __koha__user__ vs. __koha_user__ that is not caught by the provided tests.
Good catch with __koha__user__. I hadn't used that return value anywhere yet. Following my unit tests on Bug 30962 and looking at t/Koha/REST/Plugin/Query.t, I think I now know how to write the tests you're talking about. I'll give it a go.
It would be great (also) if you could perltidy some of this code. I usually select the code I want to tidy, and just ctrl+k ctrl+f on VScode. Please do it inline. Thanks!
I think there's a problem with the perltidy vim macro in KTD but otherwise I'm open to it... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139313|0 |1 is obsolete| | --- Comment #41 from David Cook <dcook@prosentient.com.au> --- Created attachment 144968 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144968&action=edit Koha Plugin with Mojolicious controller Updating attached plugin to use updated staff interface templates and to use some code updates -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #140673|0 |1 is obsolete| | --- Comment #42 from David Cook <dcook@prosentient.com.au> --- Created attachment 144969 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144969&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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #140674|0 |1 is obsolete| | --- Comment #43 from David Cook <dcook@prosentient.com.au> --- Created attachment 144970 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144970&action=edit Bug 31380: Add plugin hook for choosing Mojolicious or CGI script controller This change checks for a "use_mojolicious" method in the plugin in order to determine whether it should use a Mojolicious controller or a CGI script controller. Note that the check is for the existence of the method, so it is backwards compatible with all existing Koha Plugins. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #140675|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #44 from David Cook <dcook@prosentient.com.au> --- I've added a lot more tests, streamlined the code more, and resolved an issue with the authorization process. I could probably add a couple more end-to-end tests but I've run out of time today and I'm away the next 5 days. Moving this back to "Needs Signoff" to get eyes on it in the meantime... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Needs Signoff |Failed QA --- Comment #45 from Lucas Gass <lucas@bywatersolutions.com> --- Several things the QA script complains about, all of which look like easy fixes: FAIL Koha/Mojo/Plugins/Core.pm FAIL forbidden patterns forbidden pattern: tab char (line 84) forbidden pattern: tab char (line 85) forbidden pattern: tab char (line 86) forbidden pattern: tab char (line 87) FAIL koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-home.tt FAIL forbidden patterns forbidden pattern: Do not use line breaks inside template tags (bug 18675) (line 150) FAIL koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt FAIL forbidden patterns forbidden pattern: Do not use line breaks inside template tags (bug 18675) (line 160) And perltidy :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 --- Comment #46 from David Cook <dcook@prosentient.com.au> --- Thanks for looking, Lucas. :) Ran out of time today, but I'll try to get to those tomorrow. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 --- Comment #47 from David Cook <dcook@prosentient.com.au> --- Oddly without any changes I'm getting the following: testing 2 commit(s) (applied to 00fb85d 'fc Bug 34275: Add toggle switch for b') Processing files before patches |========================>| 10 / 10 (100.00%) Processing files after patches |========================>| 10 / 10 (100.00%) OK Koha/Auth.pm OK Koha/Mojo/Plugins/Core.pm OK Koha/Mojo/Staff.pm OK Koha/Mojo/Staff/Controller/Plugins.pm OK Koha/Template.pm OK koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-home.tt OK koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt OK t/db_dependent/Koha/Auth.t FAIL t/db_dependent/Koha/Mojo/Plugins/Core.t FAIL file permissions File must have the exec flag OK t/db_dependent/Koha/Template.t Processing additional checks OK! Running tests (3) * Proving /kohadevbox/koha/t/db_dependent/Koha/Template.t KO! Cannot detect source of '/kohadevbox/koha/t/db_dependent/Koha/Template.t'! at /usr/share/perl/5.34/TAP/Parser/IteratorFactory.pm line 256. TAP::Parser::IteratorFactory::detect_source(TAP::Parser::IteratorFactory=HASH(0x5578694732d0), TAP::Parser::Source=HASH(0x55786933c148)) called at /usr/share/perl/5.34/TAP/Parser/IteratorFactory.pm line 211 TAP::Parser::IteratorFactory::make_iterator(TAP::Parser::IteratorFactory=HASH(0x5578694732d0), TAP::Parser::Source=HASH(0x55786933c148)) called at /usr/share/perl/5.34/TAP/Parser.pm line 472 TAP::Parser::_initialize(TAP::Parser=HASH(0x55786930d9c0), HASH(0x5578691627f0)) called at /usr/share/perl/5.34/TAP/Object.pm line 55 TAP::Object::new("TAP::Parser", HASH(0x5578691627f0)) called at /usr/share/perl/5.34/TAP/Object.pm line 130 TAP::Object::_construct(TAP::Harness=HASH(0x557868bfdc48), "TAP::Parser", HASH(0x5578691627f0)) called at /usr/share/perl/5.34/TAP/Harness.pm line 856 TAP::Harness::make_parser(TAP::Harness=HASH(0x557868bfdc48), TAP::Parser::Scheduler::Job=HASH(0x55786930d738)) called at /usr/share/perl/5.34/TAP/Harness.pm line 655 TAP::Harness::_aggregate_single(TAP::Harness=HASH(0x557868bfdc48), TAP::Parser::Aggregator=HASH(0x557868bfd858), TAP::Parser::Scheduler=HASH(0x55786930d708)) called at /usr/share/perl/5.34/TAP/Harness.pm line 747 TAP::Harness::aggregate_tests(TAP::Harness=HASH(0x557868bfdc48), TAP::Parser::Aggregator=HASH(0x557868bfd858), "/kohadevbox/koha/t/db_dependent/Koha/Template.t") called at /usr/share/perl/5.34/TAP/Harness.pm line 558 TAP::Harness::__ANON__() called at /usr/share/perl/5.34/TAP/Harness.pm line 571 TAP::Harness::runtests(TAP::Harness=HASH(0x557868bfdc48), "/kohadevbox/koha/t/db_dependent/Koha/Template.t") called at /usr/share/perl/5.34/App/Prove.pm line 548 App::Prove::_runtests(App::Prove=HASH(0x557868bca518), HASH(0x55786903ce78), "/kohadevbox/koha/t/db_dependent/Koha/Template.t") called at /usr/share/perl/5.34/App/Prove.pm line 506 App::Prove::run(App::Prove=HASH(0x557868bca518)) called at /usr/bin/prove line 13 * Proving /kohadevbox/koha/t/db_dependent/Koha/Mojo/Plugins/Core.t KO! Can't locate Koha/Auth.pm in @INC (you may need to install the Koha::Auth module) (@INC contains: /kohadevbox/koha /kohadevbox/koha/lib /kohadevbox/qa-test-tools /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.34.0 /usr/local/share/perl /5.34.0 /usr/lib/x86_64-linux-gnu/perl5/5.34 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.34 /usr/share/perl/5.34 /usr/local/lib/site_perl /var/lib/koha/kohadev/plugins) at /kohadevbox/koha/Koha/M ojo/Plugins/Core.pm line 22. BEGIN failed--compilation aborted at /kohadevbox/koha/Koha/Mojo/Plugins/Core.pm line 22. Compilation failed in require at (eval 1958) line 1. # Looks like your test exited with 255 before it could output anything. /kohadevbox/koha/t/db_dependent/Koha/Mojo/Plugins/Core.t .. Dubious, test returned 255 (wstat 65280, 0xff00) Failed 2/2 subtests Test Summary Report ------------------- /kohadevbox/koha/t/db_dependent/Koha/Mojo/Plugins/Core.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 2 tests but ran 0. Files=1, Tests=0, 2 wallclock secs ( 0.02 usr 0.00 sys + 1.45 cusr 0.09 csys = 1.56 CPU) Result: FAIL * Proving /kohadevbox/koha/t/db_dependent/Koha/Auth.t KO! Cannot detect source of '/kohadevbox/koha/t/db_dependent/Koha/Auth.t'! at /usr/share/perl/5.34/TAP/Parser/IteratorFactory.pm line 256. TAP::Parser::IteratorFactory::detect_source(TAP::Parser::IteratorFactory=HASH(0x55631048f6e0), TAP::Parser::Source=HASH(0x5563103585e8)) called at /usr/share/perl/5.34/TAP/Parser/IteratorFactory.pm line 211 TAP::Parser::IteratorFactory::make_iterator(TAP::Parser::IteratorFactory=HASH(0x55631048f6e0), TAP::Parser::Source=HASH(0x5563103585e8)) called at /usr/share/perl/5.34/TAP/Parser.pm line 472 TAP::Parser::_initialize(TAP::Parser=HASH(0x556310329f50), HASH(0x55631017ddf0)) called at /usr/share/perl/5.34/TAP/Object.pm line 55 TAP::Object::new("TAP::Parser", HASH(0x55631017ddf0)) called at /usr/share/perl/5.34/TAP/Object.pm line 130 TAP::Object::_construct(TAP::Harness=HASH(0x55630fc16a58), "TAP::Parser", HASH(0x55631017ddf0)) called at /usr/share/perl/5.34/TAP/Harness.pm line 856 TAP::Harness::make_parser(TAP::Harness=HASH(0x55630fc16a58), TAP::Parser::Scheduler::Job=HASH(0x556310329cc8)) called at /usr/share/perl/5.34/TAP/Harness.pm line 655 TAP::Harness::_aggregate_single(TAP::Harness=HASH(0x55630fc16a58), TAP::Parser::Aggregator=HASH(0x556310075248), TAP::Parser::Scheduler=HASH(0x556310329c98)) called at /usr/share/perl/5.34/TAP/Harness.pm line 747 TAP::Harness::aggregate_tests(TAP::Harness=HASH(0x55630fc16a58), TAP::Parser::Aggregator=HASH(0x556310075248), "/kohadevbox/koha/t/db_dependent/Koha/Auth.t") called at /usr/share/perl/5.34/TAP/Harness.pm line 558 TAP::Harness::__ANON__() called at /usr/share/perl/5.34/TAP/Harness.pm line 571 TAP::Harness::runtests(TAP::Harness=HASH(0x55630fc16a58), "/kohadevbox/koha/t/db_dependent/Koha/Auth.t") called at /usr/share/perl/5.34/App/Prove.pm line 548 App::Prove::_runtests(App::Prove=HASH(0x55630fbe6518), HASH(0x556310059348), "/kohadevbox/koha/t/db_dependent/Koha/Auth.t") called at /usr/share/perl/5.34/App/Prove.pm line 506 App::Prove::run(App::Prove=HASH(0x55630fbe6518)) called at /usr/bin/prove line 13 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 --- Comment #48 from David Cook <dcook@prosentient.com.au> --- Something very weird is going on with the QA tools... I'll pull down everything again and retry koha-testing-docker but bizarre... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 --- Comment #49 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #48)
Something very weird is going on with the QA tools...
I'll pull down everything again and retry koha-testing-docker but bizarre...
Switching back to "master" from "master-jammy" and doing a full "docker-compose pull" seems to have fixed the problem. Hurray! Now for me to fix all the things... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #144969|0 |1 is obsolete| | --- Comment #50 from David Cook <dcook@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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #144970|0 |1 is obsolete| | --- Comment #51 from David Cook <dcook@prosentient.com.au> --- Created attachment 158584 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158584&action=edit Bug 31380: Add plugin hook for choosing Mojolicious or CGI script controller This change checks for a "use_mojolicious" method in the plugin in order to determine whether it should use a Mojolicious controller or a CGI script controller. Note that the check is for the existence of the method, so it is backwards compatible with all existing Koha Plugins. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This change allows Koha release notes| |plugins that return a true | |value from the | |"use_mojolicious" method to | |be run as Mojolicious | |controllers rather than CGI | |script controllers. | | | |This | |change also sets up a | |framework for using writing | |new Koha functionality | |using Mojolicious | |controllers. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|This change allows Koha |This change allows Koha release notes|plugins that return a true |plugins that return a true |value from the |value from the |"use_mojolicious" method to |"use_mojolicious" method to |be run as Mojolicious |be run as Mojolicious |controllers rather than CGI |controllers rather than CGI |script controllers. |script controllers. | | |This |This |change also sets up a |change also sets up a |framework for using writing |framework for writing new |new Koha functionality |Koha functionality using |using Mojolicious |Mojolicious controllers. |controllers. | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 --- Comment #52 from David Cook <dcook@prosentient.com.au> --- Since writing this plugin, I've done more work on plugins, and maybe it's not a good idea. I mean the framework for using Mojolicious is still good but maybe not the stuff for plugins... For instance, opac/opac-account-pay-return.pl calls the "opac_online_payment_end" and passes a CGI object as the controller. There's no way of really making that a Mojolicious controller. So this would really only work for "report" and "tool" plugins. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 --- Comment #53 from David Cook <dcook@prosentient.com.au> --- Despite my efforts to save these patches just now... it's probably best to mark this as RESOLVED WISHLIST. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |no-sandbox -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|martin.renvoize@ptfs-europe | |.com | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|martin.renvoize@ptfs-europe |testopia@bugs.koha-communit |.com |y.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=37603 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|release-notes-needed | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31380 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jake.deery@openfifth.co.uk -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org