On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Several updated 2.6.0 sites I have list this error when using the manager:

    [2017-11-08 14:21:05] (ERROR @ /home/core/model/modx/modparser.class.php : 538) Could not find snippet with name .

    I haven’t managed to pin it down to a particular manager page or action.

    Any idea on tracing the snippet, whether it is me causing it, a bug or feature?

    This question has been answered by matdave. See the first response.

    • This won't be much help, but I think it would be either a snippet tag that refers to a snippet that no longer exists (or has its name misspelled), or an instance of $modx->runSnippet() in code somewhere that does the same thing.
        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
      • It is help, thank you. I thought it may reference an unfound asset, but was not sure at all. I will have a trawl.
        • I seem to be getting the same errors appearing since upgrade to 2.6.0.... nothing has changed other than the version.
            Helen Warner
            Number one pixel!
            Proud to be linked with MODX at Crimson Pixel
          • No luck picking through things yet here, I’m going to have another look over the weekend.

            Other than error messages filling my logs, I don’t see problems. I have not been able to find problems in the functioning of front end or manager of sites with this issue. It seems to be fairly random in showing itself.
            • discuss.answer
              There's a new system setting called log_snippet_not_found. If you set that to No then the error will go away.
                Mat Dave Jones
              • Thank you very much!
                • I see this quite a lot actually, although not with the name of the snippet being blank. I think in your case, BobRay is probably correct but I think I'd still expect the name of the snippet being called to appear? Or, you have something in a template/chunk which is effectively causing [[]] to be rendered/parsed.

                  The errors I get are slightly more helpful:

                  /core/model/modx/modparser.class.php : 538) Could not find snippet with name #9.pagetitle.

                  There are many of these, with multiple resource IDs. My case is fastField related and my thinking is that it's something to do with the order or how MODX is parsing the template. I've traced it down to a Wayfinder chunk that contains the following:

                  <dl id="subnav"[[+wf.classes]]>
                    <dt><a href="[[~[[UltimateParent? &topLevel=`2`]]]]">[[#[[UltimateParent? &topLevel=`2`]].pagetitle]]</a></dt>

                  The error isn't triggered 100% of the time though which makes me think that when it doesn't appear, the page (or chunk) is probably being pulled from cache. In either case, the chunk appears to render correctly (I'd expect the navigation label on the page to be missing if the snippet really couldn't be found).

                  I'm not a fan of hiding error messages but if anyone has a clue why this could be happening, it could help others. This error message was introduced after an upgrade to 2.6.0.

                  • [[#[[UltimateParent? &topLevel=`2`]].pagetitle]]

                    My guess is that fast-field (being a plugin that runs when the page is first loaded) is parsing the tag before UltimateParent has time to run. IIRC, FastField replaces the MODX parser. I've never trusted it for that reason. It probably could use an update.

                    Replacing the FastField stuff with a dedicated snippet might solve it, since you'd have more control over when it runs.

                    FWIW, I don't use FastField and have never seen that error in the log.
                      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
                    • Ah - I didn't realise this was how fastField worked. I did wonder why there wasn't an obvious snippet for it but thought nothing of it...

                      You're probably right, a dedicated snippet would probably make sense given how basic my use of it is. I guess that's one of the problems with Extras like these, they encourage laziness!