Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-21778 - Contact image uploaded from drupal webform don't render o… #11681

Merged
merged 1 commit into from
Feb 22, 2018

Conversation

jitendrapurohit
Copy link
Contributor

@jitendrapurohit jitendrapurohit commented Feb 16, 2018

…n summary page

Overview

Fix display of contact image which is uploaded from a webform.

Before

Contact image uploaded from drupal webform doesn't render on the summary page.

image

After

Image loads correctly without any notice errors.

Technical Details

Image uploaded from a Drupal webform resides in its own webform directory placed at sites/default/files/webform. This PR extends getImageURL() to look for exact url image if it is not found in our customFileUploadDir path.


@colemanw
Copy link
Member

@monishdeb could you take a look at that? This function was your change I believe, in CRM-19501. What was the reason for restricting the location to that one directory?

@monishdeb
Copy link
Member

monishdeb commented Feb 22, 2018

@colemanw as I recall, that change, to pick that directory here was inspired by how image preview page works, which uses the same location to display or download file see here as because, all the file uploads stores at customFileUploadDir dir.

CRM-19501 was an improvement to use customFileUploadDir to get absolute file path and using that, retrieves the thumbnail coordinates of the uploaded image.

As per this patch is concerened, it makes the getImageURL() flexible enough to decide imageURL based on photo argument present in image url or not, which is correct though as I tested though different scenario in Civi. And also ensured that there is no sideffect due to this change. Hence merging.

@colemanw colemanw merged commit f8b254e into civicrm:master Feb 22, 2018
@mlutfy mlutfy added this to the 4.7.32 milestone Mar 6, 2018
@jitendrapurohit jitendrapurohit deleted the CRM-21778 branch March 12, 2018 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants