Merge pull request #19354 from demeritcowboy/php74-more-more
[civicrm-core.git] / CRM / Custom / Form / Option.php
index 60c941c3dbdb1ad38f63daeec2ff7c3cbb02ba54..e392a9af7dd5a7e544f1665c7feab676cdcc73d8 100644 (file)
@@ -397,7 +397,6 @@ SELECT count(*)
     $oldWeight = NULL;
     if ($this->_id) {
       $customOption->id = $this->_id;
-      CRM_Core_BAO_CustomOption::updateCustomValues($params);
       $oldWeight = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', $this->_id, 'weight', 'id');
     }
     else {
@@ -484,7 +483,9 @@ SELECT count(*)
       }
     }
 
-    CRM_Core_BAO_CustomOption::updateValue($customOption->id, $customOption->value);
+    if ($this->_id) {
+      CRM_Core_BAO_CustomOption::updateValue($customOption->id, $customOption->value);
+    }
     $customOption->save();
 
     $msg = ts('Your multiple choice option \'%1\' has been saved', [1 => $customOption->label]);