I have some resources which I use to save information of downloadable documents (via TVs). I also have a TV called [*related-downloads*] which is used to pick one or more downloads for a given page. (I use ddTree to receive a list of downloads to choose from when editing a page.) Now I want to display these downloads via Ditto.
The problem: When I insert the resource IDs to be shown, it works perfectly.
[[Ditto? &documents=`21,22` &showPublishedOnly=`1` &sortBy=`pagetitle` &sortDir=`ASC` &tpl=`related-download-list` &tplFirst=`related-download-list-first` &language=`german`]]
But as soon as I change the “21,22” to the [*related-downloads*] TV, I receive an error message when I try to load the page.
[[Ditto? &documents=`[*related-downloads*]` &showPublishedOnly=`1` &sortBy=`pagetitle` &sortDir=`ASC` &tpl=`related-download-list` &tplFirst=`related-download-list-first` &language=`german`]]
This is the error message I get:
« MODx Parse Error »
MODx encountered the following error while attempting to parse the requested resource:
« Execution of a query to the database failed - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ’[*related-downloads*]) AND sc.published=1 AND sc.deleted=0) AND’ at line 3 »
SQL: SELECT DISTINCT sc.id FROM `d00ccd19`.`modx_site_content` sc LEFT JOIN `d00ccd19`.`modx_document_groups` dg on dg.document = sc.id WHERE (sc.id IN ([*related-downloads*]) AND sc.published=1 AND sc.deleted=0) AND (sc.privateweb=0) GROUP BY sc.id
What I don’t understand:
1. The output of the TV [*related-downloads*] is correct. When I just insert the TV in the template, “21,22” is displayed exactly as it should be. So Ditto seems to have a problem with the TV itself, since it obviously doesn’t even come to the point where it should receive the TV output.
2. In one of my test installations the same scenario (just with slightly different TV names) works perfectly with the TV inside the &documents parameter.
Anyone has any ideas how to solve this?