From 455d8c420fe115d7fc1e588886e2ea4bd719ca9a Mon Sep 17 00:00:00 2001 From: kurund Date: Wed, 28 Aug 2013 01:40:10 +0530 Subject: [PATCH] CRM-13209, image url should not be required if already set ---------------------------------------- * CRM-13209: Mandatory custom fields, on edit, always require a new upload (regression) http://issues.civicrm.org/jira/browse/CRM-13209 --- CRM/Profile/Form.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CRM/Profile/Form.php b/CRM/Profile/Form.php index 5db324da76..4a083cc8c5 100644 --- a/CRM/Profile/Form.php +++ b/CRM/Profile/Form.php @@ -505,7 +505,8 @@ class CRM_Profile_Form extends CRM_Core_Form { } } } - } else { + } + else { foreach ($this->_fields as $name => $field) { if ($customFieldID = CRM_Core_BAO_CustomField::getKeyID($name)) { $htmlType = $field['html_type']; @@ -522,9 +523,7 @@ class CRM_Profile_Form extends CRM_Core_Form { if ($htmlType == 'File') { $entityId = $this->_id; - if (CRM_Utils_Array::value('field_type', $field) == 'Activity' && - $this->_activityId - ) { + if (CRM_Utils_Array::value('field_type', $field) == 'Activity' && $this->_activityId) { $entityId = $this->_activityId; } $url = CRM_Core_BAO_CustomField::getFileURL($entityId, $customFieldID); @@ -564,6 +563,7 @@ class CRM_Profile_Form extends CRM_Core_Form { $this->assign("imageThumbWidth", $imageThumbWidth); $this->assign("imageThumbHeight", $imageThumbHeight); $this->assign("imageURL", $this->_defaults['image_URL']); + $this->removeFileRequiredRules('image_URL'); } if (array_key_exists('contact_sub_type', $this->_defaults) && -- 2.25.1