We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8425
    • 159 Posts
    Hello,
    I can use this line of code in a snippet in Rev 2.2.6
    return $modx->runSnippet('getResourceField', array(
              'id' => $docId, 
    		  'field' => $val, 
    		  'processTV' => 1
    ));

    but when I want to access it from an external php file, it returns an http 500 error using:
    define('MODX_CORE_PATH', '.../core/');
    require_once '.../config.core.php';
    require_once MODX_CORE_PATH.'model/modx/modx.class.php';
    $modx = new modX();
    $modx->initialize('web');
    $modx->getService('error','error.modError');
    
    
    $ret = $modx->runSnippet('getResourceField', array(
              'id' => $docId, 
    		  'field' => $val, 
    		  'processTV' => 1
    
    

    Does anyone know why?
    Thank you. [ed. note: eclipseTalk last edited this post 13 years, 7 months ago.]