Bug 37872 - System information tab on About Koha page crashes with plugins disabled and ILLModule enabled
Summary: System information tab on About Koha page crashes with plugins disabled and I...
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Plugin architecture (show other bugs)
Version: 24.05
Hardware: All All
: P5 - low normal
Assignee: Andreas Jonsson
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-09 18:13 UTC by Andreas Jonsson
Modified: 2024-09-11 13:12 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes an issue when plugins are not enabled and the ILL module is enabled. This caused an error on the About Koha > System information section.
Version(s) released in:
Circulation function:


Attachments
Bug 37872: Add guards for enable_plugins (1.45 KB, patch)
2024-09-09 18:15 UTC, Andreas Jonsson
Details | Diff | Splinter Review
Bug 37872: Add guards for enable_plugins (1.50 KB, patch)
2024-09-09 21:46 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Jonsson 2024-09-09 18:13:27 UTC
This is similar to bug 35930.
Comment 1 Andreas Jonsson 2024-09-09 18:15:31 UTC
Created attachment 171227 [details] [review]
Bug 37872: Add guards for enable_plugins

There are ILL-backends that are not implemented as
Koha plugins and does not require plugins to be enabled.

The 'new' method in Koha::Plugins returns undefined if
plugins are disabled.  Therefore, calls to this method
must be guarded by a check that plugins actually are enabled.

Testplan for koha-testing-docker:

- Edit /etc/koha/sites/kohadev/koha-conf.xml and disable plugins by
  setting <enable_plugins>0</enable_plugins>
- sudo koha-mysql kohadev -e "UPDATE systempreferences SET value='1' WHERE variable='ILLModule';"
- Run restart_all.
- In staff interface, go to About koha -> System information. The page
  should load normally (as opposed to returning 500 internal server
  error).
Comment 2 David Nind 2024-09-09 21:46:36 UTC
Created attachment 171237 [details] [review]
Bug 37872: Add guards for enable_plugins

There are ILL-backends that are not implemented as
Koha plugins and does not require plugins to be enabled.

The 'new' method in Koha::Plugins returns undefined if
plugins are disabled.  Therefore, calls to this method
must be guarded by a check that plugins actually are enabled.

Testplan for koha-testing-docker:

- Edit /etc/koha/sites/kohadev/koha-conf.xml and disable plugins by
  setting <enable_plugins>0</enable_plugins>
- sudo koha-mysql kohadev -e "UPDATE systempreferences SET value='1' WHERE variable='ILLModule';"
- Run restart_all.
- In staff interface, go to About koha -> System information. The page
  should load normally (as opposed to returning 500 internal server
  error).

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2024-09-09 21:49:02 UTC
Testing notes (using KTD):

1. I tested on main.
2. I updated the assignee
Comment 4 Jonathan Druart 2024-09-11 13:12:17 UTC
git grepped to avoid yet another bug and found:

Koha/ILL/Request.pm
 408 sub get_backend_plugin {
 409     my ( $self, $backend_id ) = @_;
 410 
 411     my @backend_plugins = Koha::Plugins->new()->GetPlugins(

Not relevant as well?