CRM-13209, fixes to remove required if file exists
authorkurund <kurund@civicrm.org>
Thu, 22 Aug 2013 20:18:30 +0000 (01:48 +0530)
committerkurund <kurund@civicrm.org>
Thu, 22 Aug 2013 20:18:30 +0000 (01:48 +0530)
----------------------------------------
* CRM-13209: Mandatory custom fields, on edit, always require a new upload (regression)
  http://issues.civicrm.org/jira/browse/CRM-13209

CRM/Core/BAO/CustomGroup.php

index 295255a04df82aac5b3106f0cc2ebe0733308b3d..83636eb6be931a874a3790a548c93166a41e2e15 100644 (file)
@@ -1475,7 +1475,7 @@ ORDER BY civicrm_custom_group.weight,
         $required = CRM_Utils_Array::value('is_required', $field);
         //fix for CRM-1620
         if ($field['data_type'] == 'File') {
-          if (isset($field['element_value']['data'])) {
+          if (!empty($field['element_value']['data'])) {
             $required = 0;
           }
         }