We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21191
    • 236 Posts
    Ditto Call
    [[Ditto? &startID=`133` &dateFormat=`%b %d` &dateSource=`pub_date` &summarize=`5` &total=`5` &hideFolders=`1`&tpl=`podcast_tpl`&sortBy=`pub_date` debug=`1`]]

    Ditto TPL
    [+date+] returns 1969
    [+pub_date+] returns a valid timestamp

    How I got here?
    I upgraded the modx install, this all used to work fine.

    I then got an error for my event listing page, a full blown MODx parse error. Turns out the ditto class was looking for a string, but was getting an array from the $timestamp variable in ditto.class.inc.php

    on line 294 we change $placeholders[’date’] = strftime($dateFormat,$timestamp); to $placeholders[’date’] = strftime($dateFormat,$timestamp[1]); notice the [1]. this fixed my event listing, however the event listing used a TV for the date, my podcast solution uses pub_date.

    Anyone have any ideas?
      ~Shawn Himmelberger
      Check out my MODx Development and MODx Design Company - Himmelberger Design
      • 27708 MODX Staff
      • 2,502 Posts
      Shawn,

      What version of Ditto are you using? AFAIK you should be using &parents instead of &startId in the current versions. I don’t know if this is the issue but it might be worth trying.

      Jay
        Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
        • 21191
        • 236 Posts
        I’m using 2.1 and changed startID to parents, no dice.. when I run the debugger it shows the pub_date as a valid timestamp
          ~Shawn Himmelberger
          Check out my MODx Development and MODx Design Company - Himmelberger Design
          • 1343 ☆ A M B ☆
          • 2,213 Posts
          Didn’t someone create a snippet a year or two ago to address this issue with newspublisher? I have been trying to find the link as I have noticed this issue on some of my sites.
            Patrick | Server Wrangler
            About Me: Website | Tweets |  MODX Hosting
            • 21191
            • 236 Posts
            It appears to be a problem with the 9.6.3 upgrade .. I took a fresh install of the ditto snippet, resource files and the copy/paste snippet and it appears to be working now. I also did the same for reflect for good measure.
              ~Shawn Himmelberger
              Check out my MODx Development and MODx Design Company - Himmelberger Design
              • 12941
              • 87 Posts
              I’m having this problem too. What is the copy/paste snippet?

              I just replaced ditto and reflect and it did absolutely nothing.
                • 36592
                • 970 Posts
                Are you using cached form [[...]] for Ditto snippet call ?
                What happens when you use uncached form [!...!] ?