EPrints Technical Mailing List Archive
See the EPrints wiki for instructions on how to join this mailing list and related information.
Message: #07096
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
Re: [EP-tech] Overriding subroutines
- To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>
- Subject: Re: [EP-tech] Overriding subroutines
- From: "Alan.Stiles" <alan.stiles@open.ac.uk>
- Date: Tue, 23 Jan 2018 17:03:40 +0000
Thanks Adam. That seems to have done the job! Alan From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk]
On Behalf Of Adam Field Hi Alan Try: use EPrints::Plugin::Screen::MyPlugin::Stuff; sub EPrints::Plugin::Screen::MyPlugin::Stuff::method_name { print ‘2’; } …in your cfg.d file. -- Adam From:
eprints-tech-bounces@ecs.soton.ac.uk> on behalf of "Alan.Stiles" <alan.stiles@open.ac.uk> 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. *** Options:
http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech *** Archive:
http://www.eprints.org/tech.php/ *** EPrints community wiki:
http://wiki.eprints.org/ *** EPrints developers Forum:
http://forum.eprints.org/ |
- Follow-Ups:
- Re: [EP-tech] Overriding subroutines
- From: "Alan.Stiles" <alan.stiles@open.ac.uk>
- Re: [EP-tech] Overriding subroutines
- References:
- Re: [EP-tech] Overriding subroutines
- From: Adam Field <adam@adamfield.net>
- Re: [EP-tech] Overriding subroutines
- From: "Alan.Stiles" <alan.stiles@open.ac.uk>
- Re: [EP-tech] Overriding subroutines
- Prev by Date: Re: [EP-tech] Overriding subroutines
- Next by Date: Re: [EP-tech] doctype views with monograph-type and pres_type
- Previous by thread: [EP-tech] EPrints/CRIS
- Next by thread: [EP-tech] DOI handling in orcid_support_advance
- Index(es):