Everything seems to be set up correctly - I am able to get the resource Id's back from my error log, but when I execute the runSnippet, i get the "Call to a member function on a non-object" error.
I'm not sure where I am going wrong. Any suggestions?
Thank you!
$resource = $modx->getObject('modResource',array(
'published' => 1,
'pagetitle' => $_GET['pagetitle']
));
if ( $resource )
{
$pagetitle = $resource->get('pagetitle');
$id = $resource->get('id');
error_log( 'getting resource id: '.$id );
$output = $modx->runSnippet('getResourceField', array(
'id' => $id,
'isTV' => 1,
'processTV' => 1,
'field' => 'productlogo'
));
if ( $output != '' )
{
error_log( 'output: '.$output );
}
}