[NFC] minor function tidy up - stop using array.
authoreileen <emcnaughton@wikimedia.org>
Fri, 25 May 2018 06:07:20 +0000 (18:07 +1200)
committereileen <emcnaughton@wikimedia.org>
Fri, 25 May 2018 06:07:20 +0000 (18:07 +1200)
Also don't set a couple of params that aren't needed

CRM/Admin/Form/Options.php
CRM/Core/OptionValue.php
CRM/Report/Form/Register.php

index ab26fb3919a7af90e530ac9d0666463cbaf2ab68..bcb7739e148ef556b7d6cb6f0f798ad1a820fbff 100644 (file)
@@ -450,7 +450,6 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form {
       }
     }
     else {
-      $ids = array();
       $params = $this->exportValues();
 
       // allow multiple defaults within group.
index 682e9a61cc6c3bba5a9f3813d96ff8cf12a887e6..4a9885f9c9768112f136f0d68d17829fc92e92eb 100644 (file)
@@ -196,8 +196,7 @@ class CRM_Core_OptionValue {
    * @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 @@ class CRM_Core_OptionValue {
       $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;
   }
 
index ac43b1bc9b50bd7130c55150e7c8a698455352eb..094520df38ef897606ae060162ceabac4242d219 100644 (file)
@@ -190,7 +190,6 @@ class CRM_Report_Form_Register extends CRM_Core_Form {
     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);