Change to Contact Item Field "mail" property?
We have had this code running for months, made no changes today and today we get this warning:
Notice: Undefined index: mail in /var/www/helpdesk/libs/PTOrganization.class.php on line 645
Here is the code snippet and I marked line 645 in left margin...
foreach( $this->orgItem->fields as $afield ){
$fieldclass = get_class($afield);
//printTrace( "afield: ".dump($afield->__attributes) );
switch( $fieldclass ){
case 'PodioContactItemField':
$fields[$afield->external_id."_name"] = $afield->__attributes['values'][0]['value']['name'];
Line 645 ==> $fields[$afield->external_id."email"] = $afield->_attributes['values'][0]['value']['mail'][0];
break;
case 'PodioCategoryItemField':
$fields[$afield->external_id] = $afield->values[0]['value']['id'];
printTrace( "init: $afield->external_id:". $afield->values[0]['value']['id'] );
break;
default:
$fields[$afield->external_id] = $afield->humanized_value();
}
}
-
Thank you Endress, I noticed this started working again yesterday. So your preference would be for us to get the profile ID and then do another API call to get the users profile in order to retrieve their email address?
This would of course not mean better performance for us with another API call.
Let me know if that's what you mean. Or you have some other idea.
Please sign in to leave a comment.
Comments
7 comments