[Bug 26163] New: Add plugin directories to PERL5LIB

classic Classic list List threaded Threaded
29 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] New: Add plugin directories to PERL5LIB

bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

            Bug ID: 26163
           Summary: Add plugin directories to PERL5LIB
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Architecture, internals, and plumbing
          Assignee: [hidden email]
          Reporter: [hidden email]
        QA Contact: [hidden email]

It would be nice if we could create Koha objects and schema files to be used in
plugins. The problem is that by the time the
Plugin directories are added to @INC only at the point that Koha::Plugins is
evaluated. This is too late for loading additional Schema files that may be
part of a plugin.

In addition, it makes sense to allow plugins to have a 'lib' directory so that
any additional object and schema files can be stored inside the plugin assets
directory and not pollute the root plugins directory. Without such a 'lib'
directory, we would need to place them in the plugins directory such as
'/var/lib/koha/instancename/plugins/Koha/MyObject.pm'. This file would not be
removed when the plugin is uninstalled.

--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] Add plugin directories to PERL5LIB

bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

Kyle M Hall <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|[hidden email]-commun |[hidden email]
                   |ity.org                     |

--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] Add plugin directories to PERL5LIB

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

Kyle M Hall <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|enhancement                 |minor

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] Add plugin directories to PERL5LIB

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

Kyle M Hall <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |Needs Signoff

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] Add plugin directories to PERL5LIB

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

--- Comment #1 from Kyle M Hall <[hidden email]> ---
Created attachment 107899
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=107899&action=edit
Bug 26163: Add plugin directories to PERL5LIB

It would be nice if we could create Koha objects and schema files to be used in
plugins. The problem is that by the time the
Plugin directories are added to @INC only at the point that Koha::Plugins is
evaluated. This is too late for loading additional Schema files that may be
part of a plugin.

In addition, it makes sense to allow plugins to have a 'lib' directory so that
any additional object and schema files can be stored inside the plugin assets
directory and not pollute the root plugins directory. Without such a 'lib'
directory, we would need to place them in the plugins directory such as
'/var/lib/koha/instancename/plugins/Koha/MyObject.pm'. This file would not be
removed when the plugin is uninstalled.

Test Plan:
1) Apply this patch
2) Start koha-testing-docker or Update your plack.psgi file with the changes
from the patch ( e.g. /etc/koha/sites/kohadevbox/plack.psgi )
3) Install the Kitchen Sink plugin, version 2.1.42
 
https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases/download/v2.1.42/koha-plugin-kitchen-sink-v2.1.42.kpz
4) Restart all the things!
5) Note the message "Kitchen Sink test module was loaded!" in the plack error
log when you visit the plugin's pages ( confi, tool, report )

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] Add plugin directories to PERL5LIB

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

David Cook <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--- Comment #2 from David Cook <[hidden email]> ---
Could you elaborate more on the rationale for this change? I don't understand
it at all.

Also, the change to koha-plack has the same problem as Bug 25778. The PERL5LIB
will grow and grow each time you restart that starman instance.

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] Add plugin directories to PERL5LIB

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

--- Comment #3 from Kyle M Hall <[hidden email]> ---
(In reply to David Cook from comment #2)
> Could you elaborate more on the rationale for this change? I don't
> understand it at all.
>
> Also, the change to koha-plack has the same problem as Bug 25778. The
> PERL5LIB will grow and grow each time you restart that starman instance.

Basically, it's so that plugins can have DBIC schema files.

We should be able to test PERL5LIB to see if the path already exists in and to
not add it if it does.

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] Add plugin directories to PERL5LIB

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

--- Comment #4 from David Cook <[hidden email]> ---
(In reply to Kyle M Hall from comment #3)
> Basically, it's so that plugins can have DBIC schema files.
>

I was hoping for more of a technical explanation, but I think I understand
after re-reading the earlier comments. The plugin developer would provide DBIC
schema files with the plugin in the lib directory, and if the plugin is loaded
early enough, then Koha::Database will detect them?

I am all for using DBIC schema files. It would make plugins a lot easier to
write.

However, wouldn't that mean that you'd have to restart Starman before being
able to use the plugin? Shouldn't that requirement should be surfaced to users
(even if only as a warning)?

> We should be able to test PERL5LIB to see if the path already exists in and
> to not add it if it does.

Since koha-plack uses bash, we could try something like the following (although
I admit it uses bash magic I haven't fully understood yet):

[[ ":$PATH:" != *":/path/to/add:"* ]] && PATH="${PATH}:/path/to/add"

(https://unix.stackexchange.com/questions/217622/add-path-to-path-if-not-already-in-path)

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] Add plugin directories to PERL5LIB

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

Tomás Cohen Arazi <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]
         Depends on|                            |25778


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25778
[Bug 25778] koha-plack puts duplicate entries into PERL5LIB when multiple
instances named
--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] Add plugin directories to PERL5LIB

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

Tomás Cohen Arazi <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email],
                   |                            |[hidden email]-c
                   |                            |ommunity.org

--- Comment #5 from Tomás Cohen Arazi <[hidden email]> ---
This is such a great idea Kyle. We need to document it once pushed. I hope we
can even backport this.

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] Add plugin directories to PERL5LIB

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

--- Comment #6 from Tomás Cohen Arazi <[hidden email]> ---
I made it dependent on bug 25778 because that bugfix should be pushed ASAP as
well, to the stable branches.

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] Add plugin directories to PERL5LIB

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

--- Comment #7 from David Cook <[hidden email]> ---
(In reply to Tomás Cohen Arazi from comment #6)
> I made it dependent on bug 25778 because that bugfix should be pushed ASAP
> as well, to the stable branches.

Thanks, Tomas. That would remove my concern!

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] Add plugin directories to PERL5LIB

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

Martin Renvoize <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |martin.renvoize@ptfs-europe
                   |                            |.com

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] Add plugin directories to PERL5LIB

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

Kyle M Hall <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |25698


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25698
[Bug 25698] Curbside Pickup
--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] Add plugin directories to PERL5LIB

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

Tomás Cohen Arazi <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Needs Signoff               |Signed Off

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] Add plugin directories to PERL5LIB

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

Tomás Cohen Arazi <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #107899|0                           |1
        is obsolete|                            |

--- Comment #8 from Tomás Cohen Arazi <[hidden email]> ---
Created attachment 108524
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=108524&action=edit
Bug 26163: Add plugin directories to PERL5LIB

It would be nice if we could create Koha objects and schema files to be used in
plugins. The problem is that by the time the
Plugin directories are added to @INC only at the point that Koha::Plugins is
evaluated. This is too late for loading additional Schema files that may be
part of a plugin.

In addition, it makes sense to allow plugins to have a 'lib' directory so that
any additional object and schema files can be stored inside the plugin assets
directory and not pollute the root plugins directory. Without such a 'lib'
directory, we would need to place them in the plugins directory such as
'/var/lib/koha/instancename/plugins/Koha/MyObject.pm'. This file would not be
removed when the plugin is uninstalled.

Test Plan:
1) Apply this patch
2) Start koha-testing-docker or Update your plack.psgi file with the changes
from the patch ( e.g. /etc/koha/sites/kohadevbox/plack.psgi )
3) Install the Kitchen Sink plugin, version 2.1.42
 
https://github.com/bywatersolutions/koha-plugin-kitchen-sink/releases/download/v2.1.42/koha-plugin-kitchen-sink-v2.1.42.kpz
4) Restart all the things!
5) Note the message "Kitchen Sink test module was loaded!" in the plack error
log when you visit the plugin's pages ( confi, tool, report )

Signed-off-by: Tomas Cohen Arazi <[hidden email]>

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] Add plugin directories to PERL5LIB

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

--- Comment #9 from David Cook <[hidden email]> ---
I came to apologize for not signing this one off last night, but looks like
Tomas has already signed off. Hurray!

I'm actually quite looking forward to this change going in.

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] Add plugin directories to PERL5LIB

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

--- Comment #10 from Katrin Fischer <[hidden email]> ---
If you signed it off still, we could count Tomas for towards QA if he agrees.

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] Add plugin directories to PERL5LIB

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

--- Comment #11 from David Cook <[hidden email]> ---
(In reply to Katrin Fischer from comment #10)
> If you signed it off still, we could count Tomas for towards QA if he agrees.

Ok I could do that

I was actually wondering about that same methodology for Bug 22417...

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] Add plugin directories to PERL5LIB

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

--- Comment #12 from Tomás Cohen Arazi <[hidden email]> ---
I was going to write the same but got a mid air collision. Never hesitate to
add your signature, even if I wasn't a QA team member. It means something for
the QA members and the RM.

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] Add plugin directories to PERL5LIB

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

David Cook <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Signed Off                  |Failed QA

--- Comment #13 from David Cook <[hidden email]> ---
Failing QA.

The plugin doesn't show at
http://localhost:8081/cgi-bin/koha/plugins/plugins-home.pl

I also get the following in /var/log/koha/kohadev/plack-error.log:

Can't locate TestModule.pm in @INC (you may need to install the TestModule
module) (@INC contains: /kohadevbox/koha /kohadevbox/koha/installer
/kohadevbox/koha/lib/installer /etc/perl
/usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/loca
l/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5
/usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24
/usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base
/var/lib/koha/kohadev/plugins) at /var/lib/ko
ha/kohadev/plugins/Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm line 27.
Compilation failed in require at /usr/share/perl/5.24/Module/Load.pm line 77.
Can't locate Koha/Plugin/Com/ByWaterSolutions/KitchenSink in @INC (@INC
contains: /kohadevbox/koha /kohadevbox/koha/installer
/kohadevbox/koha/lib/installer /etc/perl
/usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24
.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5
/usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24
/usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base
/var/lib/koha/kohadev/plugins) at /usr/share/perl/5.24/Module/
Load.pm line 77.
Kitchen Sink test module was loaded! at
/var/lib/koha/kohadev/plugins/Koha/Plugin/Com/ByWaterSolutions/KitchenSink/lib/TestModule.pm
line 4.

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] Add plugin directories to PERL5LIB

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

Kyle M Hall <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Failed QA                   |Needs Signoff

--- Comment #14 from Kyle M Hall <[hidden email]> ---
This is actually due to the plugin design being bad. Can you try again using
the curbside pickup plugin
(https://github.com/bywatersolutions/koha-plugin-curbside-pickup)? Basically,
to make this work, the plugin needs to 'require' libraries in the lib directory
using of 'use'ing them, as the libs won't be available until the plugin is
installed and plack is restarted.

(In reply to David Cook from comment #13)

> Failing QA.
>
> The plugin doesn't show at
> http://localhost:8081/cgi-bin/koha/plugins/plugins-home.pl
>
> I also get the following in /var/log/koha/kohadev/plack-error.log:
>
> Can't locate TestModule.pm in @INC (you may need to install the TestModule
> module) (@INC contains: /kohadevbox/koha /kohadevbox/koha/installer
> /kohadevbox/koha/lib/installer /etc/perl
> /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/loca
> l/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5
> /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24
> /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base
> /var/lib/koha/kohadev/plugins) at /var/lib/ko
> ha/kohadev/plugins/Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm line 27.
> Compilation failed in require at /usr/share/perl/5.24/Module/Load.pm line 77.
> Can't locate Koha/Plugin/Com/ByWaterSolutions/KitchenSink in @INC (@INC
> contains: /kohadevbox/koha /kohadevbox/koha/installer
> /kohadevbox/koha/lib/installer /etc/perl
> /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24
> .1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5
> /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24
> /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base
> /var/lib/koha/kohadev/plugins) at /usr/share/perl/5.24/Module/
> Load.pm line 77.
> Kitchen Sink test module was loaded! at
> /var/lib/koha/kohadev/plugins/Koha/Plugin/Com/ByWaterSolutions/KitchenSink/
> lib/TestModule.pm line 4.

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] Add plugin directories to PERL5LIB

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

--- Comment #15 from Kyle M Hall <[hidden email]> ---
(In reply to Kyle M Hall from comment #14)
> This is actually due to the plugin design being bad.

I just wanted to clarify that I'm mean I designed the kitchen sink plugin
addition to test this badly.

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] Add plugin directories to PERL5LIB

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

--- Comment #16 from David Cook <[hidden email]> ---
(In reply to Kyle M Hall from comment #15)
> I just wanted to clarify that I'm mean I designed the kitchen sink plugin
> addition to test this badly.

No worries. I've just looked at the plugin and I see what you mean.

I'll have to take a look at it later, but I'll make a note to do it with the
curbside plugin.

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] Add plugin directories to PERL5LIB

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

Galen Charlton <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #108524|0                           |1
        is obsolete|                            |

--- Comment #17 from Galen Charlton <[hidden email]> ---
Created attachment 109216
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109216&action=edit
Bug 26163: Add plugin directories to PERL5LIB

It would be nice if we could create Koha objects and schema files to be
used in plugins. The problem is that by the time the Plugin directories
are added to @INC only at the point that Koha::Plugins is evaluated.
This is too late for loading additional Schema files that may be part of
a plugin.

In addition, it makes sense to allow plugins to have a 'lib' directory
so that any additional object and schema files can be stored inside the
plugin assets directory and not pollute the root plugins directory.
Without such a 'lib' directory, we would need to place them in the
plugins directory such as
'/var/lib/koha/instancename/plugins/Koha/MyObject.pm'.
This file would not be removed when the plugin is uninstalled.

Test Plan:
1) Apply this patch
2) Start koha-testing-docker or Update your plack.psgi file with the changes
from the patch ( e.g. /etc/koha/sites/kohadevbox/plack.psgi )
3) Install the curbside pickup plugin, 1.0.9:
 
https://github.com/bywatersolutions/koha-plugin-curbside-pickup/releases/tag/v1.0.9
4) Restart all the things!
5) Verify that the curbside pickup plugin's config and tools interfaces appear.

Signed-off-by: Tomas Cohen Arazi <[hidden email]>
Signed-off-by: Galen Charlton <[hidden email]>

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] Add plugin directories to PERL5LIB

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

Galen Charlton <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Needs Signoff               |In Discussion
                 CC|                            |[hidden email]

--- Comment #18 from Galen Charlton <[hidden email]> ---
The patch works for me with the curbside pickup plugin, and I'd be comfortable
treating the kitchen sink plugin as not handling its interior modules as it
should. Consequently, I've attached my signoff and tweaked the commit message a
bit.

That said... this may not be necessary after all. I've worked out an approach
to have plugins register their own custom DBIx result classes without requiring
that koha-plack munge PERL5LIB in advance. See the pull request on the plugin
here:

https://github.com/bywatersolutions/koha-plugin-curbside-pickup/pull/7

If that pull request holds up, the approach it outlines may well obviate any
need for Koha itself to change. Consequently, I'm setting the bug status to in
discussion for the moment.

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] Add plugin directories to PERL5LIB

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

--- Comment #19 from Tomás Cohen Arazi <[hidden email]> ---
(In reply to Galen Charlton from comment #18)

> The patch works for me with the curbside pickup plugin, and I'd be
> comfortable treating the kitchen sink plugin as not handling its interior
> modules as it should. Consequently, I've attached my signoff and tweaked the
> commit message a bit.
>
> That said... this may not be necessary after all. I've worked out an
> approach to have plugins register their own custom DBIx result classes
> without requiring that koha-plack munge PERL5LIB in advance. See the pull
> request on the plugin here:
>
> https://github.com/bywatersolutions/koha-plugin-curbside-pickup/pull/7
>
> If that pull request holds up, the approach it outlines may well obviate any
> need for Koha itself to change. Consequently, I'm setting the bug status to
> in discussion for the moment.

That's great, Galen. Glad to see you submitting code!

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] Add plugin directories to PERL5LIB

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

--- Comment #20 from David Cook <[hidden email]> ---
(In reply to Galen Charlton from comment #18)
> If that pull request holds up, the approach it outlines may well obviate any
> need for Koha itself to change. Consequently, I'm setting the bug status to
> in discussion for the moment.

I reckon Galen's approach here is a more robust solution than relying on
koha-plack to "do the right thing".

This approach could probably be streamlined a bit to reduce the boilerplate
needed in each plugin as well.

+1 for the idea from me

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

[Bug 26163] Add plugin directories to PERL5LIB

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26163

Kyle M Hall <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|In Discussion               |RESOLVED
         Resolution|---                         |INVALID

--- Comment #21 from Kyle M Hall <[hidden email]> ---
(In reply to Galen Charlton from comment #18)

> The patch works for me with the curbside pickup plugin, and I'd be
> comfortable treating the kitchen sink plugin as not handling its interior
> modules as it should. Consequently, I've attached my signoff and tweaked the
> commit message a bit.
>
> That said... this may not be necessary after all. I've worked out an
> approach to have plugins register their own custom DBIx result classes
> without requiring that koha-plack munge PERL5LIB in advance. See the pull
> request on the plugin here:
>
> https://github.com/bywatersolutions/koha-plugin-curbside-pickup/pull/7
>
> If that pull request holds up, the approach it outlines may well obviate any
> need for Koha itself to change. Consequently, I'm setting the bug status to
> in discussion for the moment.

This is fantastic Galen! Thanks! I've merged your pull requests into the
plugin.

I am quite happy to close out this bug report, as Galen's solution is
definitely the better one.

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/