The getResources (1.3.0-pl) snippet is a handy thing to use in the Manager to provide input options to a TV using an @EVAL runSnippet call.
Unfortunately, it looks like when used this way in MODX Revolution 2.1.1-pl, getResources goes looking for documents in the ’mgr’ context. You can override this by specifying (say) the ’web’ context using the snippet’s context parameter; however, the snippet does not use this parameter when searching for child resources of the specified parent(s).
On line 83 of the snippet:
$pchildren = $modx->getChildIds($parent, $depth);
When the snippet is running within the Manager, this will search for resources in the ’mgr’ context. This code should be replaced with a context-sensitive search, something like this:
if (!empty($context)) {
$contexts = explode(',',$context);
$pchildren = array();
foreach ($contexts as $ctx) {
$pchildren = array_merge($pchildren, $modx->getChildIds($parent, $depth, array('context' => $ctx)));
}
unset($contexts,$ctx);
} else {
$pchildren = $modx->getChildIds($parent, $depth);
}