<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta name=Title content=""><meta name=Keywords content=""><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:Calibri;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:Calibri;
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Calibri;
        color:windowtext;}
span.msoIns
        {mso-style-type:export-only;
        mso-style-name:"";
        text-decoration:underline;
        color:teal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body bgcolor=white lang=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Hi Alan<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>                Try:<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>use EPrints::Plugin::Screen::MyPlugin::Stuff;<o:p></o:p></p><p class=MsoNormal>sub EPrints::Plugin::Screen::MyPlugin::Stuff::method_name<o:p></o:p></p><p class=MsoNormal>{<o:p></o:p></p><p class=MsoNormal>                print &#8216;2&#8217;;<o:p></o:p></p><p class=MsoNormal>}<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>&#8230;in your cfg.d file.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>--<o:p></o:p></p><p class=MsoNormal>Adam<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal style='margin-left:36.0pt'><b><span style='color:black'>From: </span></b><span style='color:black'>eprints-tech-bounces@ecs.soton.ac.uk&gt; on behalf of &quot;Alan.Stiles&quot; &lt;alan.stiles@open.ac.uk&gt;<br><b>Reply-To: </b>&lt;eprints-tech@ecs.soton.ac.uk&gt;<br><b>Date: </b>Tuesday, 23 January 2018 16:12<br><b>To: </b>&quot;eprints-tech@ecs.soton.ac.uk&quot; &lt;eprints-tech@ecs.soton.ac.uk&gt;<br><b>Subject: </b>[EP-tech] Overriding subroutines<o:p></o:p></span></p></div><div><p class=MsoNormal style='margin-left:36.0pt'><span style='font-family:"Times New Roman"'><o:p>&nbsp;</o:p></span></p></div><p class=MsoNormal style='margin-left:36.0pt'>Hi all,<o:p></o:p></p><p class=MsoNormal style='margin-left:36.0pt'>I&#8217;m currently trying to override a subroutine from a plugin module, by redefining it in the local cfg.d file.<o:p></o:p></p><p class=MsoNormal style='margin-left:36.0pt'>So<o:p></o:p></p><p class=MsoNormal style='margin-left:36.0pt'>&nbsp;<o:p></o:p></p><p class=MsoNormal style='margin-left:36.0pt'>&lt;EPRINTS_ROOT&gt;/lib/plugins/EPrints/Plugin/Screen/MyPlugin/Stuff.pm <o:p></o:p></p><p class=MsoNormal style='margin-left:36.0pt'>has <o:p></o:p></p><p class=MsoNormal style='margin-left:36.0pt'>package EPrints::Plugin::Screen::MyPlugin::Stuff;<o:p></o:p></p><p class=MsoNormal style='margin-left:36.0pt'>sub method_name { print 1;}<o:p></o:p></p><p class=MsoNormal style='margin-left:36.0pt'>&nbsp;<o:p></o:p></p><p class=MsoNormal style='margin-left:36.0pt'>and in &lt;EPRINTS_ROOT&gt;/archives/&lt;MY_ARCHIVE&gt;/cfg/cfg.d/zzz_stuff_plugin_local.pl&nbsp; I have<o:p></o:p></p><p class=MsoNormal style='margin-left:36.0pt'>&nbsp;<o:p></o:p></p><p class=MsoNormal style='margin-left:36.0pt'>package EPrints::Plugin::Screen::MyPlugin::Stuff;<o:p></o:p></p><p class=MsoNormal style='margin-left:36.0pt'>sub method_name { print 2;}<o:p></o:p></p><p class=MsoNormal style='margin-left:36.0pt'>&nbsp;<o:p></o:p></p><p class=MsoNormal style='margin-left:36.0pt'>&nbsp;<o:p></o:p></p><p class=MsoNormal style='margin-left:36.0pt'>when I restart the server I get the print 1;&nbsp; statement.&nbsp;&nbsp; If I change the subroutine name in the plugin (under lib/plugins&#8230;.) then restart the server I get the print 2; statement so it appears to be loading the plugin after the local version?&nbsp; I thought these happened the other way round?<o:p></o:p></p><p class=MsoNormal style='margin-left:36.0pt'>&nbsp;<o:p></o:p></p><p class=MsoNormal style='margin-left:36.0pt'>Thanks,<o:p></o:p></p><p class=MsoNormal style='margin-left:36.0pt'>Alan<o:p></o:p></p><p class=MsoNormal style='margin-left:36.0pt'><span style='font-size:12.0pt;font-family:"Times New Roman"'>-- The Open University is incorporated by Royal Charter (RC 000391), an exempt charity in England &amp; 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/ <o:p></o:p></span></p></div></body></html>