Description
Kyle M Hall (khall)
2018-02-12 14:08:14 UTC
Created attachment 71481 [details] [review] Bug 20181: Allow plugins to add css and javascript to OPAC A number of Koha plugins have been written that enhance Koha's public catalog. These plugins often make due to adding css and javascript to the various opac system preferences. It would be nice if the plugin system had hooks so plugin developers could add code the the head block and the area where we include javascript in the opac template. Test Plan: 1) Apply this patch 2) Download and install the Kitchen Sink plugin ( v2.1.12 or later ) https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases/download/v2.1.12/koha-plugin-kitchen-sink-v2.1.12.kpz 3) Install the plugin 4) Restart all the things if you can ( restart_all if you are using kohadevbox ) This will ensure the plugin takes effect right away, it should be necessary but it won't hurt anything! 5) Load the opac, notice you get an alert message and the background for your opac is now orange ( assuming you've not customized the opac in any way ) Created attachment 71483 [details] [review] Bug 20181 - Unit Tests Created attachment 71563 [details] [review] Bug 20181: Followup to ensure test runs If EnablePlugins was 0, this test before this patch fails. After this patch, it passes. TEST PLAN --------- 1) Apply all but this patch 2) Run the following commands kshell prove t/Koha_Template_Plugin_KohaPlugins.t -- two tests fail, if you have the conf or syspref set to 0. 3) Apply this patch 4) Repeat step 2. -- all tests pass, including the positive and negative case checks. 5) run koha qa test tools (In reply to M. Tompsett from comment #3) > Created attachment 71563 [details] [review] [review] > Bug 20181: Followup to ensure test runs > > If EnablePlugins was 0, this test before this patch fails. > After this patch, it passes. > > TEST PLAN > --------- > 1) Apply all but this patch > 2) Run the following commands > kshell > prove t/Koha_Template_Plugin_KohaPlugins.t > -- two tests fail, if you have the conf or syspref set to 0. > 3) Apply this patch > 4) Repeat step 2. > -- all tests pass, including the positive and negative case checks. > 5) run koha qa test tools Doh, thanks Mark! Created attachment 71565 [details] [review] Bug 20181: Add POD for new plugin Created attachment 71566 [details] [review] Bug 20181: Allow plugins to add css and javascript to OPAC A number of Koha plugins have been written that enhance Koha's public catalog. These plugins often make due to adding css and javascript to the various opac system preferences. It would be nice if the plugin system had hooks so plugin developers could add code the the head block and the area where we include javascript in the opac template. Test Plan: 1) Apply this patch 2) Download and install the Kitchen Sink plugin ( v2.1.12 or later ) https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases/download/v2.1.12/koha-plugin-kitchen-sink-v2.1.12.kpz 3) Install the plugin 4) Restart all the things if you can ( restart_all if you are using kohadevbox ) This will ensure the plugin takes effect right away, it should be necessary but it won't hurt anything! 5) Load the opac, notice you get an alert message and the background for your opac is now orange ( assuming you've not customized the opac in any way ) Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Created attachment 71567 [details] [review] Bug 20181 - Unit Tests Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Created attachment 71568 [details] [review] Bug 20181: Followup to ensure test runs If EnablePlugins was 0, this test before this patch fails. After this patch, it passes. TEST PLAN --------- 1) Apply all but this patch 2) Run the following commands kshell prove t/Koha_Template_Plugin_KohaPlugins.t -- two tests fail, if you have the conf or syspref set to 0. 3) Apply this patch 4) Repeat step 2. -- all tests pass, including the positive and negative case checks. 5) run koha qa test tools Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Created attachment 71569 [details] [review] Bug 20181: Add POD for new plugin Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Created attachment 73264 [details] [review] Bug 20181: Allow plugins to add css and javascript to OPAC A number of Koha plugins have been written that enhance Koha's public catalog. These plugins often make due to adding css and javascript to the various opac system preferences. It would be nice if the plugin system had hooks so plugin developers could add code the the head block and the area where we include javascript in the opac template. Test Plan: 1) Apply this patch 2) Download and install the Kitchen Sink plugin ( v2.1.12 or later ) https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases/download/v2.1.12/koha-plugin-kitchen-sink-v2.1.12.kpz 3) Install the plugin 4) Restart all the things if you can ( restart_all if you are using kohadevbox ) This will ensure the plugin takes effect right away, it should be necessary but it won't hurt anything! 5) Load the opac, notice you get an alert message and the background for your opac is now orange ( assuming you've not customized the opac in any way ) Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 73265 [details] [review] Bug 20181: Unit tests Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 73266 [details] [review] Bug 20181: (follow-up) Ensure test runs If EnablePlugins was 0, this test before this patch fails. After this patch, it passes. TEST PLAN --------- 1) Apply all but this patch 2) Run the following commands kshell prove t/Koha_Template_Plugin_KohaPlugins.t -- two tests fail, if you have the conf or syspref set to 0. 3) Apply this patch 4) Repeat step 2. -- all tests pass, including the positive and negative case checks. 5) run koha qa test tools Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 73267 [details] [review] Bug 20181: Add POD for new plugin Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> It sounds weird to me to test UseKohaPlugins and enable_plugins in the Koha::Template::Plugin::KohaPlugins I would have expected more something like my $p = Koha::Plugins->new; return unless $p; my @plugins = $p->GetPlugins; as Koha::Plugins->new already test UseKohaPlugins. Not blocker. Created attachment 73417 [details] [review] Bug 20181 [QA Followup]: Remove double check (In reply to Jonathan Druart from comment #14) > It sounds weird to me to test UseKohaPlugins and enable_plugins in the > Koha::Template::Plugin::KohaPlugins > I would have expected more something like > my $p = Koha::Plugins->new; > return unless $p; > my @plugins = $p->GetPlugins; > > as Koha::Plugins->new already test UseKohaPlugins. > > Not blocker. I wonder if we could move the syspref check into new() as well. (In reply to Kyle M Hall from comment #16) > I wonder if we could move the syspref check into new() as well. If there was a way to determine why a new() failed, then I'd say go for it. Because there may exist cases where we wish to know why a new() failed. Did it fail because the system administrator side of it wasn't configured? Did it fail because the koha administrator turned off plugins system preference? Did it fail for some other reason? (In reply to M. Tompsett from comment #17) > (In reply to Kyle M Hall from comment #16) > > I wonder if we could move the syspref check into new() as well. > > If there was a way to determine why a new() failed, then I'd say go for it. > Because there may exist cases where we wish to know why a new() failed. > Did it fail because the system administrator side of it wasn't configured? > Did it fail because the koha administrator turned off plugins system > preference? > Did it fail for some other reason? Good thoughts. I'd say it's out of scope for this bug. I'll file a new bug report where we can deal with it. Pushed to master for 18.05, thanks to everybody involved! Enhancement, not backported for 17.11.x I've decided to backport to 17.11.x, this is very useful and not risky. Pushed to 17.11.x for 17.11.11 |