Bug 15879 - Allow multiple plugin directories to be defined in koha-conf.xml
Summary: Allow multiple plugin directories to be defined in koha-conf.xml
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Target Milestone: ---
Assignee: Kyle M Hall
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 20275
  Show dependency treegraph
 
Reported: 2016-02-22 14:25 UTC by Kyle M Hall
Modified: 2018-02-22 16:46 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:
It's now possible to define multiple plugin directories in the Koha conf file. This allows for ease of plugin development so that each plugin installed can live in its own git repository. For compatibility, the first plugindir instance defined is used for uploading plugins via the web interface.


Attachments
Bug 15879 - Allow multiple plugin directories to be defined in koha-conf.xml (2.49 KB, patch)
2016-02-22 14:29 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 15879 - Allow multiple plugin directories to be defined in koha-conf.xml (3.26 KB, patch)
2016-02-22 14:55 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 15879: Allow multiple plugin directories to be defined in koha-conf.xml (3.52 KB, patch)
2017-01-04 15:22 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 15879: Allow multiple plugin directories to be defined in koha-conf.xml (3.56 KB, patch)
2017-01-11 11:04 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15879: Add Tests (3.72 KB, patch)
2017-01-11 11:04 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2016-02-22 14:25:15 UTC
It would be very useful to be able to define multiple plugin directories in the Koha conf file. This would allow for ease of plugin development so that each plugin installed can live in its own git repository. For compatibility, the first plugindir instance defined should be the one used for uploading plugins via the web interface.
Comment 1 Kyle M Hall 2016-02-22 14:29:50 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall 2016-02-22 14:55:22 UTC
Created attachment 48297 [details] [review]
Bug 15879 - Allow multiple plugin directories to be defined in koha-conf.xml

It would be very useful to be able to define multiple plugin directories
in the Koha conf file. This would allow for ease of plugin development
so that each plugin installed can live in its own git repository. For
compatibility, the first plugindir instance defined should be the one
used for uploading plugins via the web interface.

Test Plan:
1) Apply this patch
2) Define a second pluginsdir line in your koha-conf.xml
3) Clone the kitchen sink plugin to this new path like this:
   git clone https://github.com/bywatersolutions/koha-plugin-kitchen-sink.git /path/to/new/plugins/dir
4) Restart memcached if you are running it
5) The Kitchen Sink plugin should now appear in your list of plugins!
Comment 3 Julian Maurice 2016-02-23 08:37:28 UTC
(In reply to Kyle M Hall from comment #0)
> It would be very useful to be able to define multiple plugin directories in
> the Koha conf file. This would allow for ease of plugin development so that
> each plugin installed can live in its own git repository.

I think there is a better way to achieve this. Maybe each directory inside the plugin directory should be considered as a plugin.
As an example, in Drupal 7 each directory with an .info file in it is considered as a module.
Comment 4 Kyle M Hall 2016-03-07 19:48:49 UTC
(In reply to Julian Maurice from comment #3)
> (In reply to Kyle M Hall from comment #0)
> > It would be very useful to be able to define multiple plugin directories in
> > the Koha conf file. This would allow for ease of plugin development so that
> > each plugin installed can live in its own git repository.
> 
> I think there is a better way to achieve this. Maybe each directory inside
> the plugin directory should be considered as a plugin.
> As an example, in Drupal 7 each directory with an .info file in it is
> considered as a module.

That is a good thought, but would require far more re-engineering of the plugin system ( and possibly all plugins ) to support such a system.
Comment 5 Tomás Cohen Arazi 2017-01-04 15:22:55 UTC
Created attachment 58594 [details] [review]
Bug 15879: Allow multiple plugin directories to be defined in koha-conf.xml

It would be very useful to be able to define multiple plugin directories
in the Koha conf file. This would allow for ease of plugin development
so that each plugin installed can live in its own git repository. For
compatibility, the first plugindir instance defined should be the one
used for uploading plugins via the web interface.

Test Plan:
1) Apply this patch
2) Define a second pluginsdir line in your koha-conf.xml
3) Clone the kitchen sink plugin to this new path like this:
   git clone https://github.com/bywatersolutions/koha-plugin-kitchen-sink.git /path/to/new/plugins/dir
4) Restart memcached if you are running it
5) The Kitchen Sink plugin should now appear in your list of plugins!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
I rebased it against master and tested it on a kohadevbox
Comment 6 Jonathan Druart 2017-01-11 11:04:46 UTC
Created attachment 58805 [details] [review]
Bug 15879: Allow multiple plugin directories to be defined in koha-conf.xml

It would be very useful to be able to define multiple plugin directories
in the Koha conf file. This would allow for ease of plugin development
so that each plugin installed can live in its own git repository. For
compatibility, the first plugindir instance defined should be the one
used for uploading plugins via the web interface.

Test Plan:
1) Apply this patch
2) Define a second pluginsdir line in your koha-conf.xml
3) Clone the kitchen sink plugin to this new path like this:
   git clone https://github.com/bywatersolutions/koha-plugin-kitchen-sink.git /path/to/new/plugins/dir
4) Restart memcached if you are running it
5) The Kitchen Sink plugin should now appear in your list of plugins!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
I rebased it against master and tested it on a kohadevbox

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 7 Jonathan Druart 2017-01-11 11:04:50 UTC
Created attachment 58806 [details] [review]
Bug 15879: Add Tests

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 8 Jonathan Druart 2017-01-11 11:09:46 UTC
Hum, it seems that the kpz in t/db_dependent is wrong, it contains a ctags file which is not removed on delete.

Kyle, do you want me to open a bug report for that problem?
Comment 9 Jonathan Druart 2017-01-11 11:19:02 UTC
Something else, if I uninstall the KitchenSink plugin, it is still listed in the plugin list until I restart Plack. Is it a known bug?
Comment 10 Kyle M Hall 2017-01-11 13:59:55 UTC
(In reply to Jonathan Druart from comment #8)
> Hum, it seems that the kpz in t/db_dependent is wrong, it contains a ctags
> file which is not removed on delete.
> 
> Kyle, do you want me to open a bug report for that problem?

Yes please!
Comment 11 Kyle M Hall 2017-01-11 14:01:40 UTC
(In reply to Jonathan Druart from comment #9)
> Something else, if I uninstall the KitchenSink plugin, it is still listed in
> the plugin list until I restart Plack. Is it a known bug?

Hmm, that is interesting. Definitely not a bug known to myself at least. Plack must be doing some kind of in memory caching perhaps? None of the code indicates the list of plugins is cached.
Comment 12 Kyle M Hall 2017-01-11 14:04:35 UTC
Pushed to master for 17.05!
Comment 13 Katrin Fischer 2017-01-15 16:04:20 UTC
This won't get ported back to 16.11.x as it is an enhancement.