Merge pull request from PalanteJon/fix-array-ptypes

Fix in_array and explode warnings
This commit is contained in:
Sarah Poger Gladstone 2016-05-20 09:49:35 -04:00
commit b9cca6e139

View File

@ -78,8 +78,9 @@ function fancytokens_civicrm_tokens( &$tokens ){
$p_type = ""; $p_type = "";
if( isset( $cur['group_type'])){ if( isset( $cur['group_type'])){
$p_type = $cur['group_type']; $p_type = $cur['group_type'];
// Some group_types are arrays, if the profile is used on an event form
$p_type = is_array($p_type) ? $p_type[0] : $p_type;
}
$type_array = explode( "," , $p_type); // Contributions Activity $type_array = explode( "," , $p_type); // Contributions Activity
if ( false == ( in_array("Participant", $type_array ) || in_array("Membership", $type_array ) || in_array("Household", $type_array ) || in_array("Contributions", $type_array ) || in_array("Activity", $type_array ) )) { if ( false == ( in_array("Participant", $type_array ) || in_array("Membership", $type_array ) || in_array("Household", $type_array ) || in_array("Contributions", $type_array ) || in_array("Activity", $type_array ) )) {
@ -91,6 +92,7 @@ function fancytokens_civicrm_tokens( &$tokens ){
} }
} }
}
} }