Author Topic: contact photo in view error  (Read 2103 times)

Offline vantuykom

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 0
  • CiviCRM version: 4
  • CMS version: drupal
  • MySQL version: 5
  • PHP version: 5.3
contact photo in view error
« on: August 19, 2014, 12:05:11 am »
Hi,

I want to create a view with the contact photo and contact name. The image-url is pointing to a strange path "index.php?q=civicrm/contact/imagefile&photo=NOUR_2996a37189195566a40f3127e2b8e546.jpg"
When I want to access this path, it is broken...

the photo's are displaying correct in the contact page, the true path to the picture is "sites/default/files/civicrm/custom".

What can I do to fix this (I am not a coder)

regards

Offline petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: contact photo in view error
« Reply #1 on: August 19, 2014, 12:37:10 am »
it works for us to use the rewrite option and insert <img src="[image_URL]">

but we did have an issue on sites when changes were made to where image files were stored in civi

which version of civi is yours?

does it affect all images or only 'old' ones - ie if you load up a new image does that work, or do old ones work, or neither?
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Offline vantuykom

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 0
  • CiviCRM version: 4
  • CMS version: drupal
  • MySQL version: 5
  • PHP version: 5.3
Re: contact photo in view error
« Reply #2 on: August 19, 2014, 12:40:31 am »
I'm using 4.4.6 and do the <img src="[image_URL]">
it gives a url like described above...

Offline vantuykom

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 0
  • CiviCRM version: 4
  • CMS version: drupal
  • MySQL version: 5
  • PHP version: 5.3
Re: contact photo in view error
« Reply #3 on: August 19, 2014, 02:13:39 am »
The problem is, that there is the '&amp;' in stead of just '&', and I don't know how that get there...

regards

Offline petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: contact photo in view error
« Reply #4 on: August 19, 2014, 01:18:17 pm »
and you also have "index.php?q="

doesn't drupal offer 'clean urls' or somesuch?
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Offline vantuykom

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 0
  • CiviCRM version: 4
  • CMS version: drupal
  • MySQL version: 5
  • PHP version: 5.3
Re: contact photo in view error
« Reply #5 on: August 28, 2014, 06:35:11 am »
in my development server, clean url's is not alowed

Offline choster

  • I’m new here
  • *
  • Posts: 29
  • Karma: 2
    • Lattice Group
  • CiviCRM version: 4.3,4.4,4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5.39
  • PHP version: 5.5.15
Re: contact photo in view error
« Reply #6 on: April 25, 2015, 10:00:57 pm »
We've just encountered this problem on a recent upgrade from 4.5.1 to 4.6.2. On 4.5.1, we had been using the workaround of inserting the [image_URL] token into the Rewrite field.

But now, [image_URL] no longer returns a URL, but a full img tag. The token "CiviCRM Contacts: Contact Image" as a token on Drupal 7/ Views 3, image style setting of "None (original image)," produces

Code: [Select]
<img title="" alt="" src="https://example.com/sites/example.com/files/example.com/civicrm/
contact/imagefile%3Fphoto%3DLogo360_70f5faefbd19be848df2687d1c501df2.jpg" typeof="foaf:Image">

which doesn't resolve to anything. The physical location of the file, from webroot, is

Code: [Select]
/sites/example.com/files/civicrm/custom/Logo360_70f5faefbd19be848df2687d1c501df2.jpg
Oddly, these images had been broken on the contact view page, but now display correctly, so it seems somewhere between 4.4 and 4.6, the image handling was fixed in one place but broken in another.