We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10071
    • 18 Posts
    For the last weeks i have been working on a new website on XAMP.

    Yesterday i moved the site files an database to the new hosting provider.
    There is one problem left.

    The sorting is not working probably  (or not at all).
    I didn’t have this problem on my XAMP server, there is everything working fine.

    I have been searching on the forum and found one solution but that didn’t work
    http://modxcms.com/forums/index.php/topic,21782.0.html
    http://modxcms.com/forums/index.php/topic,25845.15.html

    I think it’s the problem with the database version 5.0.51a-community

    Technical details:
    MODx versie   0.9.6.3
    Database server   localhost
    Database Version:   5.0.51a-community
    Database Karakterset   latin1
    Ditto 2.1


    This is the snippet call:
    [!Ditto?  &summarize=`3` &total=`20` &tpl=`BlogTemplate` &debug=`1` &orderBy=`pagetitle ASC` &tplFirst=`Blogtemplatefirst` &extenders=`summary` &dateFormat=`%d-%m-%Y`!]

    Debug information:
    ditto2.1.0_debug_doc29.html
    The problem is i  can’t put a new version on that server, because the hosting provider doesn’t want to.

    Is there a other solution or fix for this problem, withou upgrading the mysql version?

      • 3647
      • 177 Posts
      Have you tried the fix referred to in this post

      http://modxcms.com/forums/index.php/topic,23676.0.html

      I think this was the one that worked for me,

      Mark
        • 10071
        • 18 Posts
        What do you mean?
        Just using this query:

        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 (1,2,8,13,14,23,28,3,6,7,5,4,18,17,16,15,20,19,27,11,9,10,24,12,29,30,25,26,22,21) 
        GROUP BY sc.id
        ORDER BY sc.menuindex ASC;


        It’s not solving the problem....
          • 3647
          • 177 Posts
          Edit the snippet file:
          assets/snippets/wayfinder/wayfinder.inc.php

          Find the line (around line 350 ’ish)
          GROUP BY sc.id

          Remove the line altogether

          Then test again

            • 10071
            • 18 Posts
            When i remove row:
            $sql = "SELECT DISTINCT {$fields} FROM {$tblsc} sc LEFT JOIN {$tbldg} dg ON dg.document = sc.id WHERE sc.published=1 AND sc.deleted=0 AND ({$access}){$menuWhere} AND sc.id IN (".implode(',',$ids).") GROUP BY sc.id ORDER BY {$sort} {$this->_config['sortOrder']} {$sqlLimit};";


            Then the whole site is down.
            « MODx Parse Error »
            MODx encountered the following error while attempting to parse the requested resource:
            « Execution of a query to the database failed - Query was empty »

            Parser timing
            MySQL: 0.0003 s (0 Requests)
            PHP: 0.0345 s
            Total: 0.0349 s
              • 3647
              • 177 Posts
              maybe I am misunderstanding you

              you should only remove the statement
              GROUP BY sc.id

              is that what you did?
                • 10071
                • 18 Posts
                yes i did remove

                GROUP BY sc.id

                but that’s don’t solve the problem.
                The sorting in the front is still not working at all.

                Maybe a strange thing? WHy do I have to change Wayfinder.inc.php when it has something to do with Ditto?
                  • 25663 MODX Staff
                  • 12,272 Posts
                  Your problem is here:
                  Database Version:   5.0.51a-community 


                  That’s a known buggy version of MySQL when using Grouping and Sorting together in queries, and which is used in Ditto. Lots of posts on the forums cover it. Either upgrade to 5.0.67 or downgrade to 5.0.45.
                    Ryan Thrash, MODX Co-Founder
                    Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                    • 10071
                    • 18 Posts
                    Problem Solved.

                    They have upgraded mysql to 5.0.67 grin