Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only first loaded repository disables lib/plugins #223

Closed
drtjmb opened this issue Apr 12, 2014 · 1 comment
Closed

Only first loaded repository disables lib/plugins #223

drtjmb opened this issue Apr 12, 2014 · 1 comment

Comments

@drtjmb
Copy link
Member

@drtjmb drtjmb commented Apr 12, 2014

lib plugins should be disabled by default and enabled as required on a per-repository basis.

PluginFactory->new enforces this:

my %SYSTEM_PLUGINS; # class variable, shared by PluginFactory instances

sub new
{
        [...]
        if( !scalar keys %SYSTEM_PLUGINS ) # if system plugins not already loaded
        {
                # load perl_lib plugins
                $dir = $repository->config( "base_path" )."/perl_lib";
                $self->_load_dir( \%SYSTEM_PLUGINS, $repository, $dir );

                # load lib plugins
                $dir = $repository->config( "base_path" )."/lib/plugins";
                my @loaded = $self->_load_dir( \%SYSTEM_PLUGINS, $repository, $dir );

                # disable lib plugins
                my $conf = $repository->config( "plugins" );
                foreach my $plugin (@loaded)
                {
                        my $pluginid = $plugin->get_id();
                        if( !defined $plugin->param( "disable" ) )
                        {
                                $conf->{$pluginid}{params}{disable} = 1;
                        }
                }

If there is more than one repository a PluginFactory instance is created for each repository (via EPrints::Repository) but lib plugins are only disabled for the FIRST repository that is loaded (for subsequent repositories SYSTEM_PLUGINS is defined).

@drtjmb drtjmb changed the title Only first loaded repository disables lib and site_lib plugins Only first loaded repository disables lib/plugins Apr 12, 2014
drtjmb pushed a commit that referenced this issue Apr 12, 2014
@jiadiyao
Copy link
Contributor

@jiadiyao jiadiyao commented Sep 6, 2017

fixed by #224

@jiadiyao jiadiyao closed this Sep 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants