<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>Yes, I've noticed this too, recently. It used to be the case but doesn't seem to be any more. I would suggest disabling the plugin in its 'new' function, and enabling it in the local configuration. See <a href="http://bazaar.eprints.org/393/1/plugins/EPrints/Plugin/Export/Hello.pm">http://bazaar.eprints.org/393/1/plugins/EPrints/Plugin/Export/Hello.pm</a> and <span class="Apple-tab-span" style="white-space:pre">        </span><a href="http://bazaar.eprints.org/393/1/epm/hello_test/cfg/cfg.d/z_hello.pl">http://bazaar.eprints.org/393/1/epm/hello_test/cfg/cfg.d/z_hello.pl</a> (the bazaar package I wrote for a training video).</div><div><br></div><div><br><div>
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>--<br>Adam Field<br>Business Relationship Manager and Community Lead<br>EPrints Services</div><div><br></div></div></div><br class="Apple-interchange-newline">
</div>
<br><div><div>On 2 Nov 2015, at 12:39, John Salter <<a href="mailto:J.Salter@leeds.ac.uk">J.Salter@leeds.ac.uk</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi,<br>Just trying to verify (or otherwise) my understanding of plugins and disabling/enabling them.<br>From: <a href="http://wiki.eprints.org/w/New_Features_in_EPrints_3.3#EPrints_Bazaar">http://wiki.eprints.org/w/New_Features_in_EPrints_3.3#EPrints_Bazaar</a><br>"By default plugins installed in lib/plugins will be disabled and hence can be enabled on a per-repository basis."<br><br>On our test repository (3.3.10), we're not seeing this - things in ~/lib/plugins/... seem to be enabled for all archives.<br>This causes a problem when a plugin references a field that doesn't exist for a dataobj.<br><br>Can anyone verify that their install works as expected:<br>Is a plugin in ~/lib/plugins/... available without being specifically enabled in the archive's cfg.d?<br><br><blockquote type="cite">From the code below, you can create two screen plugins:<br></blockquote>PluginTestA: should be disabled by default, but appears to be active when visiting: <a href="http://your_repo/cgi/users/home?screen=PluginTestA">http://your_repo/cgi/users/home?screen=PluginTestA</a><br>PluginTestB: should also be disabled - and seems to work correctly: <a href="http://your_repo/cgi/users/home?screen=PluginTestB">http://your_repo/cgi/users/home?screen=PluginTestB</a> gives an error.<br><br>PluginTestA can be disabled by adding archive-level config (e.g. to ~/archives/ARCHIVEID/cfg/cfg.d/z_plugin_test.pl):<br>$c->{plugins}->{"Screen::PluginTestA"}->{params}->{disable} = 1;<br>but my understanding is that it should be disabled by default, and explicitly enabled when needed.<br><br>If you can test this, I'd appreciate it. Might be worth including the version of EPrints you're running too.<br>Cheers,<br>John<br><br><br>~/lib/plugins/EPrints/Plugin/Screen/PluginTestA.pm<br>####################################################################<br>package EPrints::Plugin::Screen::PluginTestA;<br><br>our @ISA = ( 'EPrints::Plugin::Screen' );<br><br>use strict;<br><br>sub new<br>{<br> my( $class, %params ) = @_;<br> my $self = $class->SUPER::new(%params);<br> return $self;<br>}<br><br>sub render<br>{<br> my( $self ) = @_;<br> my $repo = $self->{repository};<br> my $page = $repo->xml->create_element( "div" );<br> $page->appendChild( $repo->xml->create_text_node( "This should be disabled by default" ) );<br> return $page;<br>}<br><br>sub render_title<br>{<br> my( $self ) = @_;<br> my $f = $self->{repository}->make_doc_fragment;<br> $f->appendChild( $self->{repository}->xml->create_text_node( "This is: PluginTestA" ) );<br> return $f;<br>}<br>1;<br>####################################################################<br><br>~/lib/plugins/EPrints/Plugin/Screen/PluginTestB.pm<br>####################################################################<br>package EPrints::Plugin::Screen::PluginTestB;<br><br>our @ISA = ( 'EPrints::Plugin::Screen' );<br><br>use strict;<br><br>sub new<br>{<br> my( $class, %params ) = @_;<br> my $self = $class->SUPER::new(%params);<br> $self->{disable} = 1;<br> return $self;<br>}<br><br>sub render<br>{<br> my( $self ) = @_;<br> my $repo = $self->{repository};<br> my $page = $repo->xml->create_element( "div" );<br> $page->appendChild( $repo->xml->create_text_node( "This is explicitly disabled" ) );<br> return $page;<br>}<br><br>sub render_title<br>{<br> my( $self ) = @_;<br><br> my $f = $self->{repository}->make_doc_fragment;<br> $f->appendChild( $self->{repository}->xml->create_text_node( "This is: PluginTestB" ) );<br><br> return $f;<br>}<br>1;<br>####################################################################<br><br><br>*** Options: <a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a><br>*** Archive: <a href="http://www.eprints.org/tech.php/">http://www.eprints.org/tech.php/</a><br>*** EPrints community wiki: <a href="http://wiki.eprints.org/">http://wiki.eprints.org/</a><br>*** EPrints developers Forum: <a href="http://forum.eprints.org/">http://forum.eprints.org/</a><br></blockquote></div><br></div></body></html>