Bug 41651 - Allow plugins to specify additional dependencies
Summary: Allow plugins to specify additional dependencies
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Plugin architecture (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-16 14:11 UTC by HKS3 Tadeusz Sośnierz
Modified: 2026-01-16 16:03 UTC (History)
1 user (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 41651: Allow plugins do specify dependencies, abort installation if unmet (6.61 KB, patch)
2026-01-16 14:14 UTC, HKS3 Tadeusz Sośnierz
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description HKS3 Tadeusz Sośnierz 2026-01-16 14:11:16 UTC
Koha plugins cannot currently declare any dependencies. Not meeting them will occcasionally fail upon installation (if the main plugin class tries to load them at compile time) or runtime (if one of the other packages does, or code cleverly checks if the dependency is met).

Ideally we'd have a way of specifying if a Koha plugin depends on another Perl module, or another Koha plugin. A nice feature of this would be to able be able to declare optional dependencies, which may only be required for a subset of the Plugin's features (like in https://github.com/HKS3/koha-normalize-marc2db/blob/main/Koha/Plugin/HKS3/NormalizeMARC2DB/Jobs/VerifyAll.pm#L34). Those shouldn't prevent installation, but should still warn loudly upon plugin installation, in a way that is hard/impossible to miss (e.g. have an intermitted screen on plugins-upload.pl, with an "are you sure").

Patch incoming.
Comment 1 HKS3 Tadeusz Sośnierz 2026-01-16 14:14:39 UTC
Created attachment 191567 [details] [review]
Bug 41651: Allow plugins do specify dependencies, abort installation if unmet

This approach uses a new $metadata key, to minimize the scope of changes needed.
The downside of that is the fact that if the base plugin package requires
those dependencies in compile-time already, the code (and thus metadata itself)
will fail to load in an unhandled way.

plugins-upload.pl can't know for sure whether it's really the plugin being installed
that doesn't have its dependencies met, which is a limitation to how it currently works.