From 7b3b2c95799852215d367157a08acb477e509b53 Mon Sep 17 00:00:00 2001 From: eileen Date: Fri, 25 May 2018 18:07:20 +1200 Subject: [PATCH] [NFC] minor function tidy up - stop using array. Also don't set a couple of params that aren't needed --- CRM/Admin/Form/Options.php | 1 - CRM/Core/OptionValue.php | 7 +++---- CRM/Report/Form/Register.php | 1 - 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/CRM/Admin/Form/Options.php b/CRM/Admin/Form/Options.php index ab26fb3919a7..bcb7739e148e 100644 --- a/CRM/Admin/Form/Options.php +++ b/CRM/Admin/Form/Options.php @@ -450,7 +450,6 @@ public function postProcess() { } } else { - $ids = array(); $params = $this->exportValues(); // allow multiple defaults within group. diff --git a/CRM/Core/OptionValue.php b/CRM/Core/OptionValue.php index 682e9a61cc6c..4a9885f9c976 100644 --- a/CRM/Core/OptionValue.php +++ b/CRM/Core/OptionValue.php @@ -196,8 +196,7 @@ public static function getRows($groupParams, $links, $orderBy = 'weight', $skipE * @return CRM_Core_DAO_OptionValue * */ - public static function addOptionValue(&$params, &$groupParams, &$action, &$optionValueID) { - $ids = array(); + public static function addOptionValue(&$params, &$groupParams, $action, $optionValueID) { $params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE); // checking if the group name with the given id or name (in $groupParams) exists if (!empty($groupParams)) { @@ -245,9 +244,9 @@ public static function addOptionValue(&$params, &$groupParams, &$action, &$optio $params['name'] = $params['label']; } if ($action & CRM_Core_Action::UPDATE) { - $ids['optionValue'] = $optionValueID; + $params['id'] = $optionValueID; } - $optionValue = CRM_Core_BAO_OptionValue::add($params, $ids); + $optionValue = CRM_Core_BAO_OptionValue::add($params); return $optionValue; } diff --git a/CRM/Report/Form/Register.php b/CRM/Report/Form/Register.php index ac43b1bc9b50..094520df38ef 100644 --- a/CRM/Report/Form/Register.php +++ b/CRM/Report/Form/Register.php @@ -190,7 +190,6 @@ public function postProcess() { else { // get the submitted form values. $params = $this->controller->exportValues($this->_name); - $ids = array(); $groupParams = array('name' => ('report_template')); $optionValue = CRM_Core_OptionValue::addOptionValue($params, $groupParams, $this->_action, $this->_id);