Using the "Upload Image" field provided by this module on a webform, uploading an image for a contact results in an error on the contact page, and the image not showing up.

The error is:
Notice: Undefined index: photo in CRM_Utils_File::getImageURL() (line 953 of /.../civicrm/CRM/Utils/File.php).

It seems that Civi is expecting this field to have a url in the form
.../civicrm/contact/imagefile?photo=<filename>

This photo parameter is where the error is originating. This seems to imply that Civi is in fact expecting it to be a reference to a file in its filesystem, as opposed to just a url directly to a file, which is what this module seems to want to store for this field.

Comments

goron created an issue. See original summary.

rocxa’s picture

We have added a custom fix to the display of images uploaded by webform, but the fix is in the drupal integration module for civicrm:
https://github.com/civicrm/civicrm-drupal/blob/7.x-master/modules/views/...

images uploaded via webform or anywhere other than the contact edit screen are uploaded to somewhere that doesn't follow the expect photo= string civicrm expects. So if the uploaded photo doesn't have photo= then process it as a full url to the image instead.

    if ($this->options['image_style'] && module_exists('image') && $directory !== FALSE) {
    if ($this->options['image_style'] && module_exists('image') && $directory !== FALSE && strpos($value, 'photo=') !== false ) {

This fix was useful for us, but may be useful for others or point in the right direction for a fix in the getImageURL() function mentioned in the issue.

KarinG’s picture

Hi @rocxa - thanks for the report -> can you reproduce the issue on 7.x-5.x? That's the currently supported Drupal 7 version.

mpaulson’s picture

This issue was filed against a branch (7.x-4.x) that is no longer supported. We're sorry we did not get to work through it, but once you upgrade to 7.x-5.x, and if the issue persists, please feel free to re-open.

mpaulson’s picture

Status: Active » Closed (outdated)
Issue tags: +Global2020