Removes default for is_active & is_reserved since they now have DB defaults
authoreileen <emcnaughton@wikimedia.org>
Thu, 31 Dec 2020 19:42:41 +0000 (08:42 +1300)
committereileen <emcnaughton@wikimedia.org>
Tue, 5 Jan 2021 01:58:40 +0000 (14:58 +1300)
Is deductible already had a default but it has been fixed so we can rely on it.

CRM/Financial/BAO/FinancialType.php

index 427d8bad90de1f89f4eb1288a891a469dcf46f57..7a31cc66c60d4a9a3b0fa9dfd1de9591734c3458 100644 (file)
@@ -94,21 +94,14 @@ class CRM_Financial_BAO_FinancialType extends CRM_Financial_DAO_FinancialType {
    * a deprecation notice.
    *
    * @param array $params
-   *   Reference array contains the values submitted by the form.
+   *   Values from the database object.
    * @param array $ids
-   *   Reference array contains the id.
+   *   Array that we wish to deprecate and remove.
    *
    * @return object
    */
-  public static function add(&$params, &$ids = []) {
-    // @todo deprecate this, move the code to create & call create from add.
-    if (empty($params['id'])) {
-      $params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE);
-      $params['is_deductible'] = CRM_Utils_Array::value('is_deductible', $params, FALSE);
-      $params['is_reserved'] = CRM_Utils_Array::value('is_reserved', $params, FALSE);
-    }
-
-    // action is taken depending upon the mode
+  public static function add(array $params, $ids = []) {
+    // @todo deprecate this function, move the code to create & call create from add.
     $financialType = new CRM_Financial_DAO_FinancialType();
     $financialType->copyValues($params);
     $financialType->save();