Bug 26138 - Errors if enable_plugins is zero
Summary: Errors if enable_plugins is zero
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Plugin architecture (show other bugs)
Version: Main
Hardware: All All
: P5 - low blocker
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 26063
Blocks:
  Show dependency treegraph
 
Reported: 2020-08-04 22:01 UTC by Aleisha Amohia
Modified: 2021-12-13 21:08 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00
Circulation function:


Attachments
Bug 26138: Make Koha::Plugins->call return consistent value (2.84 KB, patch)
2020-08-05 07:33 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 26138: Make Koha::Plugins->call return consistent value (2.94 KB, patch)
2020-08-05 10:29 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 26138: Make Koha::Plugins->call return consistent value (3.00 KB, patch)
2020-08-05 11:21 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Aleisha Amohia 2020-08-04 22:01:18 UTC
Bug 26063 introduced a new way of checking plugins with Koha::Plugins->call(), except there are now errors all over the OPAC if enable_plugins is zero in the config.

Trying to submit a simple search throws this error: Can't use string ("0") as a HASH ref while "strict refs" in use at /home/vagrant/kohaclone/opac/opac-search.pl line 661

This is a bad blocker assuming every instance uses plugins.
Comment 1 Jonathan Druart 2020-08-05 07:33:29 UTC
Created attachment 107819 [details] [review]
Bug 26138: Make Koha::Plugins->call return consistent value

It must return an empty array in case the enable_plugins config flag is
disabled

Test plan:
Turn the config off in koha-conf
Start a search at the OPAC
Without this patch you got:
  Can't use string ("0") as a HASH ref while "strict refs" in use at /home/vagrant/kohaclone/opac/opac-search.pl line 661
With this patch applied you see the search result
Comment 2 Alex Buckley 2020-08-05 10:29:03 UTC
Created attachment 107825 [details] [review]
Bug 26138: Make Koha::Plugins->call return consistent value

It must return an empty array in case the enable_plugins config flag is
disabled

Test plan:
Turn the config off in koha-conf
Start a search at the OPAC
Without this patch you got:
  Can't use string ("0") as a HASH ref while "strict refs" in use at /home/vagrant/kohaclone/opac/opac-search.pl line 661
With this patch applied you see the search result

Followed test plan - works as described.

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Comment 3 Martin Renvoize (ashimema) 2020-08-05 11:21:04 UTC
Created attachment 107830 [details] [review]
Bug 26138: Make Koha::Plugins->call return consistent value

It must return an empty array in case the enable_plugins config flag is
disabled

Test plan:
Turn the config off in koha-conf
Start a search at the OPAC
Without this patch you got:
  Can't use string ("0") as a HASH ref while "strict refs" in use at /home/vagrant/kohaclone/opac/opac-search.pl line 661
With this patch applied you see the search result

Followed test plan - works as described.

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize (ashimema) 2020-08-05 11:21:35 UTC
Clear and consistent fix works as described. Passes QA scripts and no regressions found.

Passing QA
Comment 5 Jonathan Druart 2020-08-05 15:37:04 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 6 Lucas Gass (lukeg) 2020-08-13 17:56:58 UTC
doesn't apply clean to 20.05.x, will need a rebase