opengeek/getResources

Using get resources twice in a page, generated MySQL gets wrong parent ids

leejohnhanson opened this issue · 1 comments

Hi there,

Here is the Document layout i have:

Root
-home
-page1
---factorsandquestionscontainer
------factorandquestion1 (template id = 7)
------factorandquestion2 (template id = 7)
---audiocontainer
------audio1 (template id = 6)
------audio2 (template id = 6)

Here are the calls that are within the same template, one after the other as below:

[[!getResources? &parents=[[*id]] &tpl=CMM-CC-factorsandquestionstpl &where={"template:=":7} &includeTVs=1 &processTVs=1 &sortby={"pagetitle":"ASC"}&cache=0]]

[[!getResources? &parents=[[*id]] &tpl=audiotpl &where={"template:=":6} &includeTVs=1 &processTVs=1 &sortby={"pagetitle":"ASC"}&cache=0]]

The first call brings back as expected, the second doesn't. Here is the debug mysql generated, it appears that the latter call does not correctly pass the parent ids in as the parent ids of the audio is 36 in the site_content table:

[2011-05-05 19:26:07](ERROR @ /csquared/index.php) SELECT modResource.id, modResource.type, modResource.contentType, modResource.pagetitle, modResource.longtitle, modResource.description, modResource.alias, modResource.link_attributes, modResource.published, modResource.pub_date, modResource.unpub_date, modResource.parent, modResource.isfolder, modResource.introtext, modResource.richtext, modResource.template, modResource.menuindex, modResource.searchable, modResource.cacheable, modResource.createdby, modResource.createdon, modResource.editedby, modResource.editedon, modResource.deleted, modResource.deletedon, modResource.deletedby, modResource.publishedon, modResource.publishedby, modResource.menutitle, modResource.donthit, modResource.haskeywords, modResource.hasmetatags, modResource.privateweb, modResource.privatemgr, modResource.content_dispo, modResource.hidemenu, modResource.class_key, modResource.context_key, modResource.content_type FROM site_content AS modResource WHERE ( ( modResource.parent IN (14,16,24,26) AND (modResource.context_key IN ('web') OR EXISTS(SELECT 1 FROM context_resource ctx WHERE ctx.resource = modResource.id AND ctx.context_key IN ('web'))) ) AND modResource.deleted = 0 AND modResource.published = 1 AND modResource.hidemenu = 0 AND modResource.template = 6 ) ORDER BY pagetitle ASC LIMIT 5

if you need anymore info to help, just let me know,

thanks,
Lee

Are you using the cache_db setting in MODX?