Bug 35930: Add guards for plugins_enabled
authorAndreas Jonsson <andreas.jonsson@kreablo.se>
Mon, 12 Feb 2024 11:16:02 +0000 (11:16 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Thu, 15 Feb 2024 09:51:57 +0000 (10:51 +0100)
commite948906c83e7ab649337b4048064c52adf99b767
treef038dc2936dc66ebb6709cc42eef0d545285ad88
parent1f182d45aba607dbfaf63c98f97b8615e5eea09d
Bug 35930: Add guards for plugins_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.

Test plan:

* Code inspection of patch, alternatively
* Activate the ill system by installing a backend such as
  koha-illbackend-libris:
  https://github.com/Libriotech/koha-illbackend-libris
* Make sure plugins are disabled in koha-conf.xml
* In the staff interface, go to ILL requests.
* The page should load without getting an error 500.

PA amended commit message: This is not related to ILL backends being plugins or not
This is about ILL batches, where checking for metadata enrichment plugins was missing 'enable_plugins' guard
Additionally, unrelated to batches, it's also about ILLAvailability, where checking for ILL availabililty plugins was missing enable_plugins guard

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Hans PĂ„lsson <hans.palsson@hkr.se>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit fee4368cd81e4318bed14f0a082c978badca4256)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Koha/Illrequest/Workflow/Availability.pm
ill/ill-requests.pl