[Bug 41991] New: Temporarily suspend a plugin method or specific plugin class
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41991 Bug ID: 41991 Summary: Temporarily suspend a plugin method or specific plugin class Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Plugin architecture Assignee: koha-bugs@lists.koha-community.org Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org This starts from a use case where I do want to suspend a certain item plugin hook for a specific command line process. But I dont want to disable the plugin for all processes. So yes, this requires enough understanding from the admin who does that. My idea is to introduce something similar here to the override_syspref construct. To allow suspending a plugin method or class via an environment variable. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41991 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au, | |jonathan.druart@gmail.com, | |kyle@bywatersolutions.com, | |martin.renvoize@openfifth.c | |o.uk, | |nick@bywatersolutions.com, | |pedro.amorim@openfifth.co.u | |k Summary|Temporarily suspend a |Suspend a plugin method or |plugin method or specific |specific plugin class (per |plugin class |process or vhost) Status|NEW |ASSIGNED Assignee|koha-bugs@lists.koha-commun |m.de.rooy@rijksmuseum.nl |ity.org | --- Comment #1 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Any feedback appreciated. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41991 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41991 --- Comment #2 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 194514 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194514&action=edit Bug 41991: Introduce SUSPEND_PLUGIN in Koha::Plugins->call Test plan: Add a SetEnv for your staff client in Apache to suspend a plugin class. Verify that that specific plugin class was not run. Signed-off-by: Marcel de Rooy <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=41991 --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 194515 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194515&action=edit Bug 41991: Unit tests Test plan: Run t/db_dependent/Koha/Plugins/Plugins.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Marcel de Rooy <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=41991 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #194515|0 |1 is obsolete| | --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 194516 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194516&action=edit Bug 41991: Unit tests Test plan: Run t/db_dependent/Koha/Plugins/Plugins.t Signed-off-by: Marcel de Rooy <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=41991 --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 194618 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194618&action=edit Bug 41991: Allow SetEnv to work with SUSPEND_PLUGIN We need to add this to our Middleware module. Test plan: See next patch. Signed-off-by: Marcel de Rooy <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=41991 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #194514|0 |1 is obsolete| | --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 194619 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194619&action=edit Bug 41991: Introduce SUSPEND_PLUGIN in Koha::Plugins->call Test plan: Add a SetEnv for your staff client in Apache to suspend a plugin. Also add a RequestHeader as described in Koha/Middleware/SetEnv. Example: SetEnv SUSPEND_PLUGIN_report "1" RequestHeader add X-Koha-SetEnv "SUSPEND_PLUGIN_report 1" Verify that the specific plugin class/method was not run. Signed-off-by: Marcel de Rooy <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=41991 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #194516|0 |1 is obsolete| | --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 194620 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194620&action=edit Bug 41991: Unit tests Test plan: Run t/db_dependent/Koha/Plugins/Plugins.t Signed-off-by: Marcel de Rooy <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=41991 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #194620|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=41991 --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 199174 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199174&action=edit Bug 41991: Unit tests Test plan: Run t/db_dependent/Koha/Plugins/Plugins.t Signed-off-by: Marcel de Rooy <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=41991 --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Rebased last patch. Note that qa tools reports: [FAIL] Koha/Plugins.pm FAIL pod_coverage sub _restart_after_change has no pod coverage. sub _verbose has no pod coverage. But those two routines have not been added here ! So this should be ignored.. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41991 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #194618|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=41991 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #194619|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=41991 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199174|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=41991 --- Comment #10 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 199224 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199224&action=edit Bug 41991: Allow SetEnv to work with SUSPEND_PLUGIN We need to add this to our Middleware module. Test plan: See next patch. Signed-off-by: Marcel de Rooy <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=41991 --- Comment #11 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 199225 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199225&action=edit Bug 41991: Introduce SUSPEND_PLUGIN when running plugins Test plan: See next patch for unit tests. Install the test plugin (Koha::Plugin::Test) from last patch: perl -MKoha::Plugin::Test -e"Koha::Plugin::Test->new->install" Go to plugins home page in staff. Do you see TEST? Click Actions, Run report. You should get a plain text response with "Koha::Plugin::Test->report completed successfully". Now suspend the plugin by adding the following two lines in /etc/koha/apached-shared-intranet.conf: SetEnv SUSPEND_PLUGIN_report "1" RequestHeader add X-Koha-SetEnv "SUSPEND_PLUGIN_report 1" Note: this can be done before the DocumentRoot line. Restart apache (apachectl restart). Now refresh plugins-home page, click Run report again for TEST. You should get the Disabled page with a suspended warning. Cleanup: Remove the SetEnv and RequestHeader again from the apache file. Restart Apache. Remove the plugin by clicking Actions, Uninstall from plugins-home. Signed-off-by: Marcel de Rooy <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=41991 --- Comment #12 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 199226 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199226&action=edit Bug 41991: Unit tests Test plan: Verify that the test plugin commit from the BZ report is gone. Run t/db_dependent/Koha/Plugins/Plugins.t Signed-off-by: Marcel de Rooy <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=41991 --- Comment #13 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 199227 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199227&action=edit Bug 41991: [DO NOT PUSH] Test plugin for interface Patch from commit fac6537 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41991 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199225|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=41991 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199226|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=41991 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199227|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=41991 --- Comment #14 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 199228 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199228&action=edit Bug 41991: Introduce SUSPEND_PLUGIN when running plugins Test plan: See next patch for unit tests. Install the test plugin (Koha::Plugin::Test) from last patch on cmdline: perl -MKoha::Plugin::Test -e"Koha::Plugin::Test->new->install" Run this on cmdline too: perl -MKoha::Plugins -e'Koha::Plugins->call("report")' export SUSPEND_PLUGIN_report=1 perl -MKoha::Plugins -e'Koha::Plugins->call("report")' unset SUSPEND_PLUGIN_report The first call should show output, the second not. Go to plugins home page in staff. Do you see TEST? Click Actions, Run report. You should get a plain text response with "Koha::Plugin::Test->report completed successfully". Now suspend the report method by adding the following two lines in /etc/koha/apached-shared-intranet.conf: SetEnv SUSPEND_PLUGIN_report "1" RequestHeader add X-Koha-SetEnv "SUSPEND_PLUGIN_report 1" Note: this can be done before the DocumentRoot line. Restart apache (apachectl restart). Now refresh plugins-home page, click Run report again for TEST. You should get the Disabled page with a suspended warning. Cleanup: Remove the SetEnv and RequestHeader again from the apache file. Restart Apache. Remove the plugin by clicking Actions, Uninstall from plugins-home. Signed-off-by: Marcel de Rooy <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=41991 --- Comment #15 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 199229 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199229&action=edit Bug 41991: Unit tests Test plan: Verify that the test plugin commit from the BZ report is gone. Run t/db_dependent/Koha/Plugins/Plugins.t Signed-off-by: Marcel de Rooy <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=41991 --- Comment #16 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 199230 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199230&action=edit Bug 41991: [DO NOT PUSH] Test plugin for interface Patch from commit 10e25b2 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41991 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #17 from David Nind <david@davidnind.com> --- I wasn't able to get the "Disabled page with a suspended warning." from step X of the test plan. Wasn't obvious, but needed to apply the patch first before attempting the steps in the test plan. Line X of the test plan: - /etc/koha/apached-shared-intranet.conf should be /etc/koha/apache-shared-intranet.conf (apache-..., not apached-... - This is what is now in the file: 1# Apache configuration settings that are shared for every Koha instance. 2 # This file contains settings for the intranet site. 3 # 4 # This file should be included from an instance's 5 # /etc/apache2/site-available file, from within the VirtualHost section 6 # for the intranet. 7 8 SetEnv SUSPEND_PLUGIN_report "1" 9 RequestHeader add X-Koha-SetEnv "SUSPEND_PLUGIN_report 1" 10 11 DocumentRoot /usr/share/koha/intranet/htdocs Get this message when running apachectl restart: httpd not running, trying to start (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down AH00015: Unable to open logs Action 'restart' failed. The Apache error log may have more information. sudo apachectl restart works Why not use what comes with KTD? restart_all Line X of the test plan - don't get this result: You should get the Disabled page with a suspended warning. Get the "Koha::Plugin::Test->report completed successfully." (Even with clearing the browser cache.) (This is why numbering the steps in the test plan are recommended, when commenting I can then say step x .....) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41991 David Nind <david@davidnind.com> 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=41991 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #18 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Thx for testing, David. Will have a look. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41991 --- Comment #19 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to David Nind from comment #17)
Wasn't obvious, but needed to apply the patch first before attempting the steps in the test plan.
Did you apply all four patches?
Line X of the test plan: - /etc/koha/apached-shared-intranet.conf should be /etc/koha/apache-shared-intranet.conf (apache-..., not apached-...
Fixed in the test plan. Good catch.
- This is what is now in the file:
1# Apache configuration settings that are shared for every Koha instance. 2 # This file contains settings for the intranet site. 3 # 4 # This file should be included from an instance's 5 # /etc/apache2/site-available file, from within the VirtualHost section 6 # for the intranet. 7 8 SetEnv SUSPEND_PLUGIN_report "1" 9 RequestHeader add X-Koha-SetEnv "SUSPEND_PLUGIN_report 1" 10 11 DocumentRoot /usr/share/koha/intranet/htdocs
I tested outside KTD. But I assume that this apache-shared-intranet file is included in the virtual host file for Koha in /etc/apache2/sites-enabled. Could you check? Could you also run apache2cl test and verify that it does not report errors?
sudo apachectl restart works Or even apache2ctl btw.
Why not use what comes with KTD? restart_all Not sure if restart_all includes an Apache restart or only Plack. Have tried to find the code for restart_all in the ktd repo but couldnt find it..
Line X of the test plan - don't get this result: You should get the Disabled page with a suspended warning. Get the "Koha::Plugin::Test->report completed successfully." (Even with clearing the browser cache.) Thats weird if the apache file is indeed included. If it would not be, then it is an expected result.
(This is why numbering the steps in the test plan are recommended, when commenting I can then say step x .....) I will submit a test plan with numbers still.
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41991 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> 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=41991 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199224|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=41991 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199228|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=41991 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199229|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=41991 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199230|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=41991 --- Comment #20 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 199241 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199241&action=edit Bug 41991: Allow SetEnv to work with SUSPEND_PLUGIN We need to add this to our Middleware module. Test plan: See next patch. Signed-off-by: Marcel de Rooy <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=41991 --- Comment #21 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 199242 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199242&action=edit Bug 41991: Introduce SUSPEND_PLUGIN when running plugins Test plan: See next patch for unit tests. [1] Apply all patches from BZ and install the test plugin (Koha::Plugin::Test) from rhw last patch on cmdline: perl -MKoha::Plugin::Test -e"Koha::Plugin::Test->new->install" [2] Run this on cmdline too: perl -MKoha::Plugins -e'Koha::Plugins->call("report")' export SUSPEND_PLUGIN_report=1 perl -MKoha::Plugins -e'Koha::Plugins->call("report")' unset SUSPEND_PLUGIN_report (Note: The first call should show output, the second not.) [3] Go to plugins home page in staff. Do you see TEST? [4] Click Actions, Run report. You should get a plain text response with "Koha::Plugin::Test->report completed successfully". [5] Now suspend the report method by adding the following two lines in /etc/koha/apached-shared-intranet.conf: SetEnv SUSPEND_PLUGIN_report "1" RequestHeader add X-Koha-SetEnv "SUSPEND_PLUGIN_report 1" (Note: this can be done before the DocumentRoot line.) [6] Restart apache (sudo apache2ctl restart). [7] Now refresh plugins-home page, click Run report again for TEST. [8] You should get the Disabled page with a suspended warning. Cleanup: - Remove the SetEnv and RequestHeader again from the apache file. - Restart Apache. - Remove the plugin by clicking Actions, Uninstall from plugins-home. Signed-off-by: Marcel de Rooy <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=41991 --- Comment #22 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 199243 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199243&action=edit Bug 41991: Unit tests Test plan: Verify that the test plugin commit from the BZ report is gone. Run t/db_dependent/Koha/Plugins/Plugins.t Signed-off-by: Marcel de Rooy <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=41991 --- Comment #23 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 199244 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199244&action=edit Bug 41991: [DO NOT PUSH] Test plugin for interface Patch from commit d3f3b12 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41991 --- Comment #24 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Marcel de Rooy from comment #19)
(In reply to David Nind from comment #17)
Wasn't obvious, but needed to apply the patch first before attempting the steps in the test plan.
Did you apply all four patches?
Followed by a restart_all for Plack ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41991 David Nind <david@davidnind.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=41991 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199241|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=41991 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199242|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=41991 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199243|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=41991 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199244|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=41991 --- Comment #25 from David Nind <david@davidnind.com> --- Created attachment 199252 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199252&action=edit Bug 41991: Allow SetEnv to work with SUSPEND_PLUGIN We need to add this to our Middleware module. Test plan: See next patch. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41991 --- Comment #26 from David Nind <david@davidnind.com> --- Created attachment 199253 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199253&action=edit Bug 41991: Introduce SUSPEND_PLUGIN when running plugins Test plan: See next patch for unit tests. [1] Apply all patches from BZ and install the test plugin (Koha::Plugin::Test) from rhw last patch on cmdline: perl -MKoha::Plugin::Test -e"Koha::Plugin::Test->new->install" [2] Run this on cmdline too: perl -MKoha::Plugins -e'Koha::Plugins->call("report")' export SUSPEND_PLUGIN_report=1 perl -MKoha::Plugins -e'Koha::Plugins->call("report")' unset SUSPEND_PLUGIN_report (Note: The first call should show output, the second not.) [3] Go to plugins home page in staff. Do you see TEST? [4] Click Actions, Run report. You should get a plain text response with "Koha::Plugin::Test->report completed successfully". [5] Now suspend the report method by adding the following two lines in /etc/koha/apached-shared-intranet.conf: SetEnv SUSPEND_PLUGIN_report "1" RequestHeader add X-Koha-SetEnv "SUSPEND_PLUGIN_report 1" (Note: this can be done before the DocumentRoot line.) [6] Restart apache (sudo apache2ctl restart). [7] Now refresh plugins-home page, click Run report again for TEST. [8] You should get the Disabled page with a suspended warning. Cleanup: - Remove the SetEnv and RequestHeader again from the apache file. - Restart Apache. - Remove the plugin by clicking Actions, Uninstall from plugins-home. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41991 --- Comment #27 from David Nind <david@davidnind.com> --- Created attachment 199254 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199254&action=edit Bug 41991: Unit tests Test plan: Verify that the test plugin commit from the BZ report is gone. Run t/db_dependent/Koha/Plugins/Plugins.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41991 --- Comment #28 from David Nind <david@davidnind.com> --- Created attachment 199255 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199255&action=edit Bug 41991: [DO NOT PUSH] Test plugin for interface Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41991 --- Comment #29 from David Nind <david@davidnind.com> --- Hi Marcel. Now signed off. Thanks for adding the step numbers to the test plan. I don't really know how the includes etc for the Apache config work in KTD. To get the Apache changes to work in KTD: 1. sudo vi /etc/apache2/sites-available/kohadev.conf 2. Added the directives in step 5 in the Intranet virtual host section: ... SetEnv SUSPEND_PLUGIN_report "1" RequestHeader add X-Koha-SetEnv "SUSPEND_PLUGIN_report 1" DocumentRoot /kohadevbox/koha/koha-tmpl ... 3. Restarted everything (restarts Apache and Plack): restart_all David -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41991 --- Comment #30 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to David Nind from comment #29)
Hi Marcel.
Now signed off.
Thanks for adding the step numbers to the test plan.
I don't really know how the includes etc for the Apache config work in KTD.
To get the Apache changes to work in KTD: 1. sudo vi /etc/apache2/sites-available/kohadev.conf 2. Added the directives in step 5 in the Intranet virtual host section: ... SetEnv SUSPEND_PLUGIN_report "1" RequestHeader add X-Koha-SetEnv "SUSPEND_PLUGIN_report 1" DocumentRoot /kohadevbox/koha/koha-tmpl ... 3. Restarted everything (restarts Apache and Plack): restart_all
David
Great. Thx David. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org