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?
-
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
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
-
☆ 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.
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.
I’m having this problem too. What is the copy/paste snippet?
I just replaced ditto and reflect and it did absolutely nothing.
Are you using cached form [[...]] for Ditto snippet call ?
What happens when you use uncached form [!...!] ?