Bug 40083 - misc/devel/install_plugins.pl doesn't run the "install" method of plugins.
Summary: misc/devel/install_plugins.pl doesn't run the "install" method of plugins.
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-05 15:12 UTC by Arthur Suzuki
Modified: 2025-06-25 07:27 UTC (History)
1 user (show)

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


Attachments
Bug 40083: InstallPlugin actually runs "install" method. (1.37 KB, patch)
2025-06-25 07:27 UTC, Arthur Suzuki
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Arthur Suzuki 2025-06-05 15:12:47 UTC
After a couple tests, it seems that misc/devel/install_plugins.pl doesn't actually run the "install" methods of plugins.
Comment 1 Arthur Suzuki 2025-06-05 15:13:48 UTC
Managed to get it to work with this diff :
====
diff --git a/Koha/Plugins.pm b/Koha/Plugins.pm
index d93e9fe40fc..25aad2ffa2c 100644
--- a/Koha/Plugins.pm
+++ b/Koha/Plugins.pm
@@ -287,6 +287,7 @@ sub InstallPlugins {
 
             try {
                 $plugin = $plugin_class->new({ enable_plugins => $self->{'enable_plugins'} });
+               $plugin->install();
             }
             catch {
                 warn "$_"
====
Comment 2 Arthur Suzuki 2025-06-25 07:27:10 UTC
Created attachment 183486 [details] [review]
Bug 40083: InstallPlugin actually runs "install" method.

When developping a plugin or installing from the script rather than zip method, the plugin "install" method is not run.
This can result in some necessary component (like tables, configuration) not being setup, resulting in errors at plugin run.

Test plan :
- Install the kitchensink plugin by cloning the source and adding the directory to "koha-conf.xml" with the plugin_dir configuration
- Run misc/devel/install_plugins.pl
- Check the plugin table "mytable" is not created in the DB (check the code in the "install" method of kitchensink plugin)
- apply patch
- run misc/devel/install_plugins.pl again
- the plugin table should be created according to the install method.