We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8880
    • 29 Posts
    I have a split Navigation: Topmenu - Submenues, and am using Wayfinder and UltimateParent to get those.

    [tt]
    1_Home
    A_Subpage
    B_Subpage
    2_Contact
    3_OtherStuff
    C_Subpage
    D_Subpage
    [/tt]

    My call for the Topmenu is:
    [!Wayfinder? &startId=`0` &level=`1` &outerClass=`nav_main` !]


    The Submenues:
    [!Wayfinder? &startId=`[[UltimateParent]]` &outerClass=`nav_sub` !]


    This is all working very well, until I hit a page without subpages (« 2_Contact »).
    That will produce an error:

    [tt]
    « MODx Parse Error »

    MODx encountered the following error while attempting to parse the requested resource:

    « Execution of a query to the database failed - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ’3) GROUP BY sc.id ORDER BY sc.menuindex ASC’ at line 1 »

    SQL: SELECT DISTINCT sc.id, sc.menutitle, sc.pagetitle, sc.introtext, sc.menuindex, sc.published, sc.hidemenu, sc.parent, sc.isfolder, sc.description, sc.alias, sc.longtitle, sc.type,if(sc.type=’reference’,sc.content,’’) as content, sc.template, sc.link_attributes FROM `modx`.modx_site_content sc LEFT JOIN `modx`.modx_document_groups dg ON dg.document = sc.id WHERE sc.published=1 AND sc.deleted=0 AND (sc.privateweb=0) AND sc.hidemenu=0 AND sc.id IN (,3) GROUP BY sc.id ORDER BY sc.menuindex ASC ;
    [/tt]

    Can I prevent Wayfinder from making the db-call, when there are no subpages?

    Thanks,
    Sascha
      • 15987
      • 786 Posts
      Sascha,
      Thanks for pointing out that error. I have fixed it and you can find an updated version here: http://modxcms.com/forums/index.php/topic,12286.0.html

      Let me know if you have any more problems.
        • 8880
        • 29 Posts
        That solved the problem. Works like a charm now.

        I didn’t expect to see a whole new, major version, though. wink

        Thank you Kyle!