I think there is still some quirkiness with getCollection() and document types. Are any of the resources symlinks or weblinks?
Have you looked in the site_content table to see if there is anything different about the document types of the missing resources?
I figured it out. I’ve had quite a few issues with trying to get getResources to work for me, I most have mixed a few problems up. I had a resource group on those documents that apparently was keeping it from getting found. Oops.
Which leads me to another question. Is there a way to give getCollection permission to get those documents? I have logged in to the front-end, and there is a session stored that is allowed access to those docs, but it doesn’t make it’s way to getCollection.
Is there any good reason why [tt]$modx->getCollection(’modResource’, $criteria);[/tt] returns 14 documents while [tt]$modx->getCount(’modResource’, $criteria);[/tt] returns ’16’, its causing conflicts within paged results. Even though I set my page limit to 5, the because of this conflict my pages return these results: 4,5,4,1 (documents per page).
Keep in mind, 2 of the 16 documents have a resource group on them that restricts their access.
I think that’s expected (though I could be wrong) -- getCount() simply asks how many there are that fit the criteria, getCollection() asks to retrieve them and you can’t retrieve ones that the current user is restricted from seeing.
Would this work for you?
$resources = $modx->getCollection('modResource',$criteria);
$count = count($resources);
That will give you matching numbers.