CRM-8936 Uploading a file to an activity with multiple custom file fields removes the existing attached files

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 4.0.5, 4.0.6
    • Fix Version/s: 4.4.0
    • Component/s: CiviCase
    • Labels:
      None

      Description

      Editing a case activity with multiple custom file fields:

      The first time you upload file/files it works correctly so that when you go back and edit the activity you can see the files are attached. When you try to add a new file or modify one of the existing files, the new files is attached and any previously attached files are removed.

        Attachments

        1. changes.patch
          2 kB
          Mark van Rij
        2. CRM-8936.patch
          3 kB
          Web Access

          Activity

          [CRM-8936] Uploading a file to an activity with multiple custom file fields removes the existing attached files
          Donald A. Lobo added a comment -


          Would be great if you can investigate and file an issue. We can help u out on IRC

          Mark van Rij added a comment -

          I have attached a patch for civicrm/CRM/Case/Form/Activity.php 4.0.7

          The problem is that when you have a previously stored custom file field and you submit the form the file is not resubmitted and is essentially emptied.

          The code iterates over the custom fields to see if any fields have not been submitted, if the missing field is a 'File' type it then checks to see if a file has already been submitted for this field and adds the previous fileID to the custom fields.

          This may not be the best place to do these checks so feel free to point me in a better direction.

          Web Access added a comment -

          Provided patch is not working for trunk4.3 version.
          I have attached modified patch.

          Donald A. Lobo added a comment -


          Closing issues in batch on 4/16/13 since these issues have not been worked on in a long long time

          Mark van Rij added a comment -

          I can confirm the patch supplied by Web Access works with 4.3.5.
          Thanks

            People

            • Assignee:
              Donald A. Lobo
              Reporter:
              Mark van Rij

              Dates

              • Created:
                Updated:
                Resolved: