Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-13209

Mandatory custom fields, on edit, always require a new upload (regression)

    Details

    • Type: Bug
    • Status: To Backport
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.3.5
    • Fix Version/s: 4.4.0
    • Component/s: None
    • Labels:
      None

      Description

      This seems to be a regression of the bug described in CRM-1620 :

      • create a mandatory custom field on a contact record
      • create a new contact, upload a file in the custom field
      • edit contact, click save: CiviCRM will output an error that the file is mandatory. (but it has already been uploaded)

      The fix from CRM-1620 seems to be to check if there is already a value in Core/BAO/CustomGroup.php

            $groupId = CRM_Utils_Array::value('id', $group);
            foreach ($group['fields'] as $field) {
              $required = CRM_Utils_Array::value('is_required', $field);
              //fix for CRM-1620
              if ($field['data_type'] == 'File') {
                if (isset($field['customValue']['data'])) {
                  $required = 0;
                }
              }
      

      However, inspecting $field in 4.3 doesn't show any $field['customValue']['data'].

        Attachments

          Activity

            People

            • Assignee:
              kurund Kurund Jalmi
              Reporter:
              mlutfy Mathieu Lutfy
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: