Merge pull request #3342 from systopia/CRM-14741
[civicrm-core.git] / CRM / Custom / Form / Option.php
index 15760f5aae9697ff78043cb73c651b3fcf8a555a..2e8af3d9f529027f18e11004611e2d199cd3e7f1 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.4                                                |
+ | CiviCRM version 4.5                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
+ | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
  *
  */
@@ -125,7 +125,7 @@ class CRM_Custom_Form_Option extends CRM_Core_Form {
         || $fieldDefaults['html_type'] == 'Multi-Select'
         || $fieldDefaults['html_type'] == 'AdvMulti-Select'
       ) {
-        if (CRM_Utils_Array::value('default_value', $fieldDefaults)) {
+        if (!empty($fieldDefaults['default_value'])) {
           $defaultCheckValues = explode(CRM_Core_DAO::VALUE_SEPARATOR,
             substr($fieldDefaults['default_value'], 1, -1)
           );
@@ -247,6 +247,9 @@ class CRM_Custom_Form_Option extends CRM_Core_Form {
    *
    * @param array $fields posted values of the form
    *
+   * @param $files
+   * @param $form
+   *
    * @return array list of errors to be posted back to the form
    * @static
    * @access public
@@ -452,7 +455,7 @@ SELECT count(*)
         CRM_Core_DAO::VALUE_SEPARATOR,
         substr($customField->default_value, 1, -1)
       );
-      if (CRM_Utils_Array::value('default_value', $params)) {
+      if (!empty($params['default_value'])) {
         if (!in_array($customOption->value, $defVal)) {
           if (empty($defVal[0])) {
             $defVal = array($customOption->value);
@@ -497,7 +500,7 @@ SELECT count(*)
           break;
       }
 
-      if (CRM_Utils_Array::value('default_value', $params)) {
+      if (!empty($params['default_value'])) {
         $customField->default_value = $customOption->value;
         $customField->save();
       }