From 13415144eeb1281d4554e52187f7733755c64560 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Fri, 30 Sep 2016 16:52:26 -0400 Subject: [PATCH] CRM-19368 - Fix invalid argument foreach and undefined index --- CRM/Report/Form/Contact/Relationship.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CRM/Report/Form/Contact/Relationship.php b/CRM/Report/Form/Contact/Relationship.php index 6666a97a49..c5c5c60abb 100644 --- a/CRM/Report/Form/Contact/Relationship.php +++ b/CRM/Report/Form/Contact/Relationship.php @@ -588,12 +588,11 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { public function postProcess() { $this->beginPostProcess(); - $originalRelationshipTypeIdValue = $this->_params['relationship_type_id_value']; - if (!empty($this->_params['relationship_type_id_value'])) { + $originalRelationshipTypeIdValue = CRM_Utils_Array::value('relationship_type_id_value', $this->_params); + if ($originalRelationshipTypeIdValue) { $relationshipTypes = array(); $direction = array(); - $relType = array(); - foreach ($this->_params['relationship_type_id_value'] as $relationship_type) { + foreach ((array) $originalRelationshipTypeIdValue as $relationship_type) { $relType = explode('_', $relationship_type); $direction[] = $relType[1] . '_' . $relType[2]; $relationshipTypes[] = intval($relType[0]); -- 2.25.1