Hello,
So I’ve just been tearing my hair out for the last 3 hours trying to figure out why this code:
$siblings = $modx->getCollection('modResource',array(
'published' => 1,
'deleted' => 0,
'parent' => 4
));
Is throwing this error in one place on my site but not in others.
modx Cannot use object of type modResource_mysql as array
Then I realised that if I pass a limit attribute of 99, it works fine.
Am I doing something wrong here or is this the intended behaviour? If the latter, then I think there needs to be some better documentation for this (the only reason I figured it out was because I created a whole new set of resources to test it and realised it was crashing when I got to 6 child resources.) And also would a more elegant catch of the error be possible?
Out of interest, why is it limited?