We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5811
    • 1,717 Posts
    From getResources 1.2.0 (snippet.getResources.php):
    $criteria = $modx->newQuery('modResource', array(
        "`modResource`.`parent` IN (" . implode(',', $parents) . ")"
        ,"(`modResource`.`context_key` IN ({$context}) OR EXISTS(SELECT 1 FROM {$contextResourceTbl} `ctx` WHERE `ctx`.`resource` = `modResource`.`id` AND `ctx`.`context_key` IN ({$context})))"
    ));


    SELECT 1 FROM {$contextResourceTbl} `ctx` WHERE `ctx`.`resource` = `modResource`.`id` AND `ctx`.`context_key` IN ({$context}))
    will never return any record so EXISTS() will always true.