This getCollection() call gets the same resources if I change both instances of modDocument to modResource, but as it is here, two of the documents come up with empty ids and pagetitles. I don’t see anything different about them except that one is the current document. I don’t see anything different about the other one. Even odder, they appear at the correct point in the sort even though get() doesn’t get the id.
<?php
/* get all published, richtext docs created by the admin */
$c = $modx->newQuery('modDocument');
$c->where(array(
'published'=>'1',
'createdby'=>'1',
'richtext'=>'1')
);
$c->sortby('id','ASC');
$docs = $modx->getCollection('modDocument', $c);
foreach ($docs as $doc) {
echo $doc->get('pagetitle') . ' (' . $doc->get('id') . ')' . '<br />';
}
?>