We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36604
    • 268 Posts
    Hi,

    Our site running since 2013 gets it's error logs fooled by the cross context link bug since I updated to 2.5.5 (from 2.5.1):
    (ERROR in resource 79 @ /var/www/vhosts/domain.tld/httpdocs/core/model/modx/modparser.class.php : 1353) Bad link tag `[[~]]` encountered

    This is fired by every (?) pages.
    2 contexts for 2 languages.

    Just updated to 2.5.6, but his does not change anything for the error log issue.
    I read this: https://github.com/modxcms/revolution/issues/13278
    and contasted the correction of line 315 of modcontext.class.php was commited to 2.5.6 update.
    I ran the W3C dead link search on one of our site's page (one listed in the error log) and no dead link was found
    so... wtf ?


    Thank you


      • 36604
      • 268 Posts
      Quote from: elz064 at Apr 05, 2017, 09:57 AM
      Hi,

      Our site running since 2013 gets it's error logs fooled by the cross context link bug since I updated to 2.5.5 (from 2.5.1):
      (ERROR in resource 79 @ /var/www/vhosts/domain.tld/httpdocs/core/model/modx/modparser.class.php : 1353) Bad link tag `[[~]]` encountered

      This is fired by every (?) pages.
      2 contexts for 2 languages.

      Just updated to 2.5.6, but his does not change anything for the error log issue.
      I read this: https://github.com/modxcms/revolution/issues/13278
      and contasted the correction of line 315 of modcontext.class.php was commited to 2.5.6 update.
      I ran the W3C dead link search on one of our site's page (one listed in the error log) and no dead link was found
      so... wtf ?


      Thank you



      Ah!

      Just recheck and clicked on my frontend links randomely
      NOW the error logs is very quiet...?

      Seams 2.5.6 did the trick finally, but immediately. Strange because I erased the cache manually (ssh) during my upgrade procedure, so there's no obvious reason that the old context class was supposed to be in use

        • 36604
        • 268 Posts
        Wrong
        the errors are still coming.

        Any suggestions?

        Thanks




        Ah!

        Just recheck and clicked on my frontend links randomly
        NOW the error logs is very quiet...?

        Seams 2.5.6 did the trick finally, but immediately. Strange because I erased the cache manually (ssh) during my upgrade procedure, so there's no obvious reason that the old context class was supposed to be in use

          • 37105
          • 194 Posts
          It looks like one of your templates or chunks contains a typo calling a link which causes modParser to throw errors.
            Codeplaza Webdesign: for professional websites at low cost
            • 42562
            • 1,145 Posts
              TinymceWrapper: Complete back/frontend content solution.
              Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
              5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
              • 7455
              • 2,204 Posts
              Please! this sucks, this was never a problem, if a linktag was empty, so what?, just return nothing. How would i do someting like this now?

              [[+resource_id:neq=``:then=`<a href="[[~[[+resource_id]]]]? &scheme=`full`" title="[[+title]]">[[+title]]</a>`:else=`[[+title]]`]]

                follow me on twitter: @dimmy01
                • 3749
                • 24,544 Posts
                I'm not sure this is the issue, but your tag is malformed. The way you've written it, &scheme is part of the URL itself rather than a property for the link tag.

                I think this is correct:

                [[+resource_id:neq=``:then=`<a href="[[~[[+resource_id]]? &scheme=`full`]]" title="[[+title]]">[[+title]]</a>`:else=`[[+title]]`]]
                






                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 36604
                  • 268 Posts
                  Quote from: donshakespeare at May 05, 2017, 05:10 PM
                  Fix the link logic
                  https://forums.modx.com/thread/102151/how-to-prevent-link-tags-from-being-parsed-when-in-if-condition#dis-post-550471
                  [[[[+item:notempty=`~[[+item]]`]]]]


                  Hi I'm still having the error even after the change you proposed at the only place I'm using this kind of syntax..

                  Searching for "~" on the template code gives me only one occurrence, so there's no other link constructed like this.
                  and the ids of the modx doc used right there can not be empty. never.
                  The error comes on every pages. I checked all links on a simple page that fire it too. All A href are correctly populated

                  May be this have something to do with Babel.... but obviously I could not see any bad link.
                    • 3749
                    • 24,544 Posts
                    That suggests that the +item placeholder not being set (or is set later in the parsing process).

                    Is the tag for whatever sets that placeholder above the placeholder tag?

                    Sometimes it helps to look at the cached version of the page (if there is one) under core/cache/resource to see what's happening. After saving the page, you may have to visit the page in a browser before the cache file is created.
                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting
                    • Hi there,

                      I have been encountering the Bad link tag error message when using Symlinks in my pdoMenu call

                      [[pdoMenu@eidMenu? &startId=`[[UltimateParent? &topLevel=`3`]]` &displayStart=`1` &showHidden=`1` &level=`2` &outerClass=`tab` &selfClass=`current`]]


                      I have a propertyset eidMenu which includes a pdoResources call as follows:

                      @INLINE <ul class="tabs"><li[[+classes]]><a  href="[[+link]]" [[+attributes]]>[[+menutitle]]</a><ul>[[pdoResources? &parents=`3` &tpl=`linkTpl` &showHidden=`0` &resources=`-[[*id]],-[[*parent]],-102` &sortby=`menuindex` &sortdir=`ASC`]]</ul></li>[[+wrapper]]


                      The linkTpl code is:

                      <li><a href="[[~[[+id]]]]">[[+menutitle]]</a></li>


                      On the web page if I click on those pages which are Resources there are no errors recorded, as soon as I click on a page which is a Symlink the error appears. There are a total of 3 Symlinks called as a result of the pdoMenu call and each time I click on a Symlink there are two errors which appear which makes me think that this Bad link message is attributed to the other two Symlinks in the menu.

                      As far as the web pages are concerned this all works, however, the error log is being filled with these error messages:

                      /paas/c0504/www/core/model/modx/modparser.class.php : 1352) Bad link tag `[[~]]` encountered


                      Comments / thoughts / suggestion please smiley
                        Helen Warner
                        Number one pixel!
                        Proud to be linked with MODX at Crimson Pixel