OK, think I’ve got this sorted too, in UltimateParent, I’ve altered the following lines:
$pid = $modx->getParent($id,1,’id’);
(repeated in the while loop as well)
to:
$pid = $modx->getParent($id,0,’id’);
The documentation however for $modx->getParent says:
$parent = $modx->getParent(55,1,’pagetitle’);
will return the title of the parent of document 55 if the parent is published.
$parent = $modx->getParent(55,0,’id’);
will return the parent document’s id if it is not published.
However the parent document is published, it’s the current document that isn’t.