From 18cb89ba4473950a7a4913c49b088043dc8d195f Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Wed, 27 Sep 2017 20:04:36 +1000 Subject: [PATCH] CRM-21227 Fix test following merge of PR #10435 --- CRM/Admin/Form/RelationshipType.php | 2 +- CRM/Badge/Form/Layout.php | 2 +- CRM/Contact/Form/DedupeRules.php | 4 ++-- CRM/Financial/Form/FinancialBatch.php | 3 +-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/CRM/Admin/Form/RelationshipType.php b/CRM/Admin/Form/RelationshipType.php index b74ba659b8e..c42db6dc317 100644 --- a/CRM/Admin/Form/RelationshipType.php +++ b/CRM/Admin/Form/RelationshipType.php @@ -117,7 +117,7 @@ public function setDefaultValues() { $defaults['contact_types_a'] .= '__' . $defaults['contact_sub_type_a']; } - $defaults['contact_types_b'] = $defaults['contact_type_b']; + $defaults['contact_types_b'] = CRM_Utils_Array::value('contact_type_b', $defaults); if (!empty($defaults['contact_sub_type_b'])) { $defaults['contact_types_b'] .= '__' . $defaults['contact_sub_type_b']; } diff --git a/CRM/Badge/Form/Layout.php b/CRM/Badge/Form/Layout.php index 8ff71a23213..ba4d2017070 100644 --- a/CRM/Badge/Form/Layout.php +++ b/CRM/Badge/Form/Layout.php @@ -154,7 +154,7 @@ public function buildQuickForm() { public function setDefaultValues() { if (isset($this->_id)) { $defaults = array_merge($this->_values, - CRM_Badge_BAO_Layout::getDecodedData($this->_values['data'])); + CRM_Badge_BAO_Layout::getDecodedData(CRM_Utils_Array::value('data', $this->_values, '[]'))); } else { for ($i = 1; $i <= self::FIELD_ROWCOUNT; $i++) { diff --git a/CRM/Contact/Form/DedupeRules.php b/CRM/Contact/Form/DedupeRules.php index 8e7f2695cc6..3491cfb79f7 100644 --- a/CRM/Contact/Form/DedupeRules.php +++ b/CRM/Contact/Form/DedupeRules.php @@ -60,8 +60,8 @@ public function preProcess() { $this->_rgid = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, 0); $contactTypes = civicrm_api3('Contact', 'getOptions', array('field' => "contact_type")); $contactType = CRM_Utils_Request::retrieve('contact_type', 'String', $this, FALSE, 0); - if (in_array($contactType, $contactTypes['values'])) { - $this->_contactType = $contactTypes['values'][$contactType]; + if (CRM_Utils_Array::value($contactType, $contactTypes['values'])) { + $this->_contactType = CRM_Utils_Array::value($contactType, $contactTypes['values']); } elseif (!empty($contactType)) { throw new CRM_Core_Exception('Contact Type is Not valid'); diff --git a/CRM/Financial/Form/FinancialBatch.php b/CRM/Financial/Form/FinancialBatch.php index 2e049f77b4b..7ae2fc505a8 100644 --- a/CRM/Financial/Form/FinancialBatch.php +++ b/CRM/Financial/Form/FinancialBatch.php @@ -83,8 +83,7 @@ public function preProcess() { public function buildQuickForm() { parent::buildQuickForm(); $this->setPageTitle(ts('Financial Batch')); - - if (isset($this->_id)) { + if (!empty($this->_id)) { $this->_title = CRM_Core_DAO::getFieldValue('CRM_Batch_DAO_Batch', $this->_id, 'title'); CRM_Utils_System::setTitle($this->_title . ' - ' . ts('Accounting Batch')); $this->assign('batchTitle', $this->_title);