QA fix for CRM-18183
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Wed, 16 Mar 2016 10:17:11 +0000 (15:47 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Wed, 16 Mar 2016 10:17:11 +0000 (15:47 +0530)
CRM/Contact/Form/CustomData.php
CRM/Core/BAO/CustomField.php

index 04b68199068e324f86369d8abdc31238c23e68b1..2275cd9f7f7c150e6efa741a1e11a46607652939 100644 (file)
@@ -156,7 +156,7 @@ class CRM_Contact_Form_CustomData extends CRM_Core_Form {
     // when custom data is included in this page
     if (!empty($_POST['hidden_custom'])) {
       for ($i = 0; $i <= $_POST['hidden_custom_group_count'][$this->_groupID]; $i++) {
-        CRM_Custom_Form_CustomData::preProcess($this, NULL, $this->_contactSubType, $i, $this->_contactType, $this->_groupID);
+        CRM_Custom_Form_CustomData::preProcess($this, NULL, $this->_contactSubType, $i, $this->_contactType, $this->_tableID);
         CRM_Custom_Form_CustomData::buildQuickForm($this);
         CRM_Custom_Form_CustomData::setDefaultValues($this);
       }
index a562a1c1d4d619a4dec92cb2ac32fda1f6359806..013e21cb3bd3cba2605b656a44071d8a00bcc8a4 100644 (file)
@@ -1635,11 +1635,11 @@ SELECT id
 
       // rename this file to go into the secure directory only if
       // user has uploaded new file not existing verfied on the basis of $fileID
-      if (!$fileID && !rename($fName, $config->customFileUploadDir . $filename)) {
+      if (empty($fileID) && !rename($fName, $config->customFileUploadDir . $filename)) {
         CRM_Core_Error::statusBounce(ts('Could not move custom file to custom upload directory'));
       }
 
-      if ($customValueId && !$fileID) {
+      if ($customValueId && empty($fileID)) {
         $query = "
 SELECT $columnName
   FROM $tableName