[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EP-tech] Overriding subroutines



Hi all,
I'm currently trying to override a subroutine from a plugin module, by redefining it in the local cfg.d file.
So

<EPRINTS_ROOT>/lib/plugins/EPrints/Plugin/Screen/MyPlugin/Stuff.pm
has
package EPrints::Plugin::Screen::MyPlugin::Stuff;
sub method_name { print 1;}

and in <EPRINTS_ROOT>/archives/<MY_ARCHIVE>/cfg/cfg.d/zzz_stuff_plugin_local.pl  I have

package EPrints::Plugin::Screen::MyPlugin::Stuff;
sub method_name { print 2;}


when I restart the server I get the print 1;  statement.   If I change the subroutine name in the plugin (under lib/plugins....) then restart the server I get the print 2; statement so it appears to be loading the plugin after the local version?  I thought these happened the other way round?

Thanks,
Alan
-- The Open University is incorporated by Royal Charter (RC 000391), an exempt charity in England & Wales and a charity registered in Scotland (SC 038302). The Open University is authorised and regulated by the Financial Conduct Authority in relation to its secondary activity of credit broking.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20180123/0ec7689b/attachment-0001.html