here we go the bugfix for
getResources 1.1.0-pl:
from:
<?php
/* set default properties */
$tpl = !empty($tpl) ? $tpl : '';
$includeContent = !empty($includeContent) ? true : false;
$includeTVs = !empty($includeTVs) ? true : false;
$processTVs = !empty($processTVs) ? true : false;
$tvPrefix = isset($tvPrefix) ? $tvPrefix : 'tv.';
$parents = isset($parents) ? explode(',', $parents) : array($modx->resource->get('id'));
$depth = isset($depth) ? (integer) $depth : 10;
$children = array();
become:
<?php
/* set default properties */
$tpl = !empty($tpl) ? $tpl : '';
$includeContent = !empty($includeContent) ? true : false;
$includeTVs = !empty($includeTVs) ? true : false;
$processTVs = !empty($processTVs) ? true : false;
$tvPrefix = !empty($tvPrefix) ? $tvPrefix : 'tv.';
$parents = !empty($parents) ? explode(',', $parents) : array($modx->resource->get('id'));
$depth = !empty($depth) ? (integer) $depth : 10;
$children = array();
for remainder, it’s been listed again in here :
http://github.com/opengeek/getResources/issues/issue/12
And here is the
modX::getChildIds() work around proposal:
from
<?php
public function getChildIds($id= null, $depth= 10) {
$children= array ();
if ($id !== null && intval($depth) >= 1) {
$id= intval($id);
if (isset ($this->resourceMap["{$id}"])) {
if ($children= $this->resourceMap["{$id}"]) {
foreach ($children as $child) {
$processDepth = $depth - 1;
if ($c= $this->getChildIds($child, $processDepth)) {
$children= array_merge($children, $c);
}
}
}
}
}
return $children;
}
Become this:
<?php
public function getChildIds($id= null, $depth= 10) {
$children= array ();
if ($id !== null || $id === '' && (int)$depth >= 1) {
if (isset ($this->resourceMap["{$id}"])) {
$children= $this->resourceMap["{$id}"];
foreach ($children as $child) {
$processDepth = $depth - 1;
if ($c= $this->getChildIds($child, $processDepth)) {
$children= array_merge($children, $c);
}
}
}
}
return $children;
}