We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33372
    • 1,611 Posts
    When I remove the tagging parameters, I get the latest documents from the oldest folder (year). Meaning instead of showing the last two articles from 2008, it displays the last two from 2004. And if I change the parent sort order to ascending (as in the snippet call below) I get even stranger results: the oldest two articles from the the oldest folder (as if both sorts were ascending).

    [!Ditto? &parents=`68,67,65,64,63` &summarize=`2` &total=`2` &tpl=`newsheadline` &paginate=`0` &alwaysshow=`1` &orderBy=`parent ASC,alias DESC` &displayArchive=`0` &depth=`1` &trunc=`0`!]
      "Things are not what they appear to be; nor are they otherwise." - Buddha

      "Well, gee, Buddha - that wasn't very helpful..." - ZAP

      Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
      • 33372
      • 1,611 Posts
      *BUMP!* This still isn’t working for me, and the client finally noticed. Any idea why I’m getting such wacky results?
        "Things are not what they appear to be; nor are they otherwise." - Buddha

        "Well, gee, Buddha - that wasn't very helpful..." - ZAP

        Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
        • 25663 MODX Staff
        • 12,272 Posts
        Try switching "&summarize" (deprecated) with "&display". What’s &total for?
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 33372
          • 1,611 Posts
          Thanks for the tip. I usually just copy my old Ditto calls and modify them, and since the parameters change so often I almost always have at least one outdated variable name in there. As far as I understand it, &total sets a limit on the number of documents retrieved from the database (as an MySQL LIMIT), which I would think would just speed up the query a little bit.

          When I remove &total and replace &summarize with &display, I get the latest documents matching my tags but from the oldest parent folder. I think that it’s just ignoring the parent part of the orderBy value entirely, because it doesn’t matter if I make it ASC or DESC (I get the same results). My snippet call is:

          [!Ditto? &parents=`68,67,65,64,63` &display=`2` &tpl=`newsheadline` &paginate=`0` &alwaysshow=`1` &orderBy=`parent DESC, alias DESC` &displayArchive=`0` &depth=`1` &trunc=`0` &tagDelimiter=`,` &tagData=`tvtags` &tagMode=`onlyTags` &tags=`[*menutitle*]`!]

          If I can’t get this fixed soon I’m going to have to write a custom snippet to do it instead, and that would make me very sad ...
            "Things are not what they appear to be; nor are they otherwise." - Buddha

            "Well, gee, Buddha - that wasn't very helpful..." - ZAP

            Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
            • 25663 MODX Staff
            • 12,272 Posts
            You might PM Mark on this one. Not one of those MySQL 5.0.51 installs by chance is it?
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 33372
              • 1,611 Posts
              I’m not actually sure what version MySQL is on this server because it doesn’t report the version number properly. It was 4.0.2.6 and I asked the admins to update it so that I could install Pommo. They did and Pommo let me install, but phpInfo() is still reporting 4.0.2.6.

              But I assume that your basic ORDER BY syntax in queries has to be working, or I’d have all sorts of other problems...

              I may bug Mark and see if he’s had a chance to look at this more closely. I hate to be pushy, especially since he already answers a zillion support threads every day. I guess I should go through the Ditto code as well and see if I can figure it out.
                "Things are not what they appear to be; nor are they otherwise." - Buddha

                "Well, gee, Buddha - that wasn't very helpful..." - ZAP

                Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
                • 18397
                • 3,250 Posts
                Give tonight’s development version a try. It should fix the issue. It seems a few lines of the orderBy parser got transposed a few commits back...
                  • 25663 MODX Staff
                  • 12,272 Posts
                  FYI, I’m committing the same changes to the SVN trunk for the release. It will be labelled something other than Ditto 2.1 I suppose...
                    Ryan Thrash, MODX Co-Founder
                    Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                    • 33372
                    • 1,611 Posts
                    Excellent! Using the new ditto class file fixed it. The only difference between the file I had and the new one were those couple lines that were transposed, but that was the root of the problem.

                    Why is it always some little detail that causes most major programming problems?

                    THANKS for tracking it down for me!
                      "Things are not what they appear to be; nor are they otherwise." - Buddha

                      "Well, gee, Buddha - that wasn't very helpful..." - ZAP

                      Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options