I have a problem with Ditto that makes me crazy. Can anyone confirm this kind of behaviour?
If I make a new document with NewsPublisher that document doesn’t show directly in Ditto snippet. But after I edit and save any document also the newest document shows in Ditto. My Ditto snippet call is [!Ditto? &startID=`11` &summarize=`3`!]
Exactly same situation with old NewsListing works fine even if placed on same page as Ditto snippet. In this case NewsListing shows new document immediately but Ditto doesn’t.
Could it be that Newspublisher doesn’t set some date field or something the way that modx sets it when creating/saving a document..
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
-
MODX Staff
- 12,272 Posts
There are some edited/published oddities in the save_content.processor.php file that might be the cause of this. I just committed a fix for it in subversion for bug # 406 I think.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
Upon further investigation it appears that the issue lies with the cache. Ditto 1.0.2 uses a new modx array called documentMap which is generated in the cache processor to facilitate easier locating of documents. It is used in Ditto to get all the children of a given document (far faster than the older SQL method as this is already generated by the system). Unless you set NewsPublisher to clear the cache on publish, the array will not be updated, and hence Ditto will be unable to get the documents. So, simply turn on the option in NewsPublisher to clear the cache.
By the way, little typo in Ditto snippet on line 157:
$descendentDepth = (isset($descendentDepth))? $descendentDepth : 10;
Should be 1 instead of 10 according to documentation.
Thanks for catching that. FYI, I actually renamed the descendentDepth parameter in the next release simply to depth.
Is it possible to add at least a one-paragraph description to the Ditto documentation saying just what it does and what it is for?
As a newbie (to MODx, but not to computers or the Internet - I’m a software engineer for 30 years, and involved with the Intrernet since before it was called the Internet...) I haven’t a clue from the documentation of what it is used for.
Am I just clueless?
Just a simple, "Ditto is...".
Maybe that question can be answered here, and then incorporated into the documentation.