Paul G Petty

MT5 Beta 3 Error: Undefined subroutine &MT::Template::Context::_hdlr_link called

Vote 0 Votes

When I publish any part or the whole site I receive this error:

Undefined subroutine &MT::Template::Context::_hdlr_link called

... this may be because I copied templates from my 4.3.1 installation; but I'm not sure which tags -- if that's actual issue -- are incompatible.

Any advice?

11 Replies

| Add a Reply
  • ... this may be because I copied templates from my 4.3.1 installation; but I'm not sure which tags -- if that's actual issue -- are incompatible.

    It's likely an FTP issue. MT5 broke up MT::Template::ContextHandler into smaller files to address memory use issues, and you may need to clean out the lib directory and reupload it.

    • Hi Mike, can you be a little more specific when you say "the lib directory"? I’m having this problem on localhost - no FTP involved.

      I did start by updating an existing MT4 database. I’ve tried refreshing my templates for a clean start, but maybe that only trashes my changes to the MT4 templates rather than updating them to the MT5 versions…

  • I should add - by upgrade I do not mean copy into the same directory – just the database. Does not appear to be anything to do with my previous templates as I am not longer using them. If I rebuild the index templates the Edit template button takes me to the Feed - Recent entries template. If I rebuild Only page archives it takes me to the Page template:


    -




    MT.entryID = ;
    MT.commentsPerPage = ;
    MT.entryCommentCount = ;
    MT.commentIds = [];



    ​

  • Oops

    <$mt:Var name="page_layout" value="layout-wm"$>
    <mt:SetVarBlock name="nav_on"><$mt:PageID$></mt:SetVarBlock>
    
    

    <mt:SetVarBlock name="title"><$mt:PageTitle encode_html="1"$> - <$mt:BlogName encode_html="1"$></mt:SetVarBlock>
    <mt:SetVarBlock name="html_head">
    <$mt:Var name="comments_per_page" value="50"$>
    <mt:If tag="EntryCommentCount" gt="$comments_per_page">
    <script type="text/javascript">
    MT.entryID = <$mt:PageID$>;
    MT.commentsPerPage = <$mt:Var name="comments_per_page"$>;
    MT.entryCommentCount = <$mt:EntryCommentCount$>;
    MT.commentIds = [<mt:Comments sort_order="ascend" glue=","><mt:CommentID></mt:Comments>];
    </script>
    </mt:If>
    <$mt:EntryTrackbackData$>
    </mt:SetVarBlock>

    <$mt:Include module="Header" body_class="mt-page-archive"$>

    <$mt:Include module="Page Detail"$>

    <$mt:Include module="TrackBacks"$>

    <$mt:Include module="Comments"$>

    <$mt:Include module="Footer"$>

    ​


  • Retesting has demonstrated that "Undefined subroutine &MT::Template::Context::_hdlr_link called" is nothing to do with old templates. I guess I’ll just have to wait until MT5 is actually released.

  • I'm still getting this error at MT5.01 ...
    I've tried reverting templates & removing all plugins ...

    Is there a log that MT generates to try to debug these type of (vague) errors?

  • I had the same error after upgrading, and it was due to a plug-in. In my case it was Gizmos - when I removed it from the /plugins/ directory, everything worked again.

    If you can search across all the files in your plugins directory for any that refer to "_hdlr_link" you might find the culprit.

  • Same issue, with: _hdlr_if_comments

    My issue turned out to be with (sadly) Disqus plugin. Hoping we can fix soon.

    Thanks for the info, everyone!

  • Hi Eric, I'm having the similar issues with Disqus plugin as well. I get

    "Undefined subroutine &MT::Template::Context::_hdlr_if_comments_accepted called"

    I've resorted to switching it off, publishing a post, switching it back on, then publishing again until it shows the error.

    The first time I publish I see the default MT comment form and sign in. The second I see the disqus one. No idea what is causing it but have emailed help@disqus.com to see if they can resolve it.

  • Been told by Disqus that their plugin is currently not MT5 compatible but that they are working on an updated version.

Add a Reply

If you need to share template code, replace all the "<" signs with "&lt;" or use this utility.

Forum Groups

1774 6167

Last Topic: Template modules by Zielun on Feb 16, 2012

86 302

Last Topic: website entries by masoud on Oct 26, 2011

1434 5088

Last Topic: Maintenance announcement by Nick on Feb 17, 2012

695 2912

Last Topic: Insert Image / File Fails by Russ Miller on Feb 10, 2012

84 291

Last Topic: How to have some other characters in entry basename automatically written by Afshin Haghighatnia on Dec 22, 2011

174 740

Last Topic: Captcha images rendering slowly by ScottM on Feb 12, 2012

190 568

Last Topic: Analytics Reporting by michael webster on Feb 5, 2012

48 210

Last Topic: An idea and also a request by Afshin Haghighatnia on Jun 29, 2011

64 246

Last Topic: jQuery in MT 5.1 still at 1.4 - why? by perlmonkey on May 25, 2011

code.sixapart.com

137 478

Last Topic: Getting a thumbnail with xpath by Peter on Mar 13, 2011

222 720

Last Topic: Custom Field for Asset Not Appearing by android on Feb 9, 2012