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

image upload to custom field breaks if resource url not default

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.2.4
    • Fix Version/s: 4.4.0
    • Component/s: None
    • Labels:
      None

      Description

      go to directories and resource url settings and change the image folder location for each to /images (instead of persist/contribute)
      create a file-type custom field on the contact record
      upload an image to that field

      the image thumbnail now appears. but when you click the image to view the large version, it breaks.

      the issue is:
      CRM/Core/BAO/CustomGroup.php
      line 600

      when we build the imageURL value, we retrieve the imageUploadURL (configured above) and do a str_replace so that it retrieves the file from the custom folder – not the images folder. that's because ALL file type custom fields are stored in the custom folder, but we're borrowing the url construction from the imageUploadURL to create our hyperlink.

      the problem is that by hardcoding the str_replace values, we don't account for anything but the default setup. by changing the locations above, we break the url construction.

      i'm not sure the preferred way to fix this.

        Attachments

          Activity

            People

            • Assignee:
              lcdweb Brian Shaughnessy
              Reporter:
              lcdweb Brian Shaughnessy
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: