I am trying to use the Civi API within a Drupal view, in the global PHP field.
It is all working, except for when I try to use an "Available Variable" from the view, it throws and error. When I hard code the variable's value, it works, though.
The variable I am using does contain the correct data; if I return just that variable, it returns the ID it should.
The code:
civicrm_initialize();
$start_date = civicrm_api3('price_field', 'getvalue', array(
'return' => 'active_on',
'price_set_id' => $row->price_set_id,
));
return gettype($start_date);'
Error field active_on unset or not existing
I am using Drupal 7 and CiviCRM 4.6.28.