CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Problem with imageUrl not displaying on contact view
Pages: [1]

Author Topic: Problem with imageUrl not displaying on contact view  (Read 702 times)

mcarson

  • I post occasionally
  • **
  • Posts: 110
  • Karma: 5
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7.x
  • MySQL version: 5.5
  • PHP version: 5.4.22
Problem with imageUrl not displaying on contact view
October 02, 2011, 12:27:08 am
Finally performed the update to CiviCRM from 3.3.5 to 3.4.6 early this morning. I have noticed a small problem with the contact images not displaying. A 'broken-link' icon is displayed instead. (IE9 and Chrome)
Further investigation into the source of the page showed that the link was wrong. The imageUrl should have https://blah rather than the current http://blah.

I checked the SQL, and the urls are correct. I also attempted to check the source in: CRM/Contact/BAO/Contact/Utils.php and the regexps look okay (to me, anyways)

Another note though, perhaps related. Our SSL certificate has expired; getting a new one when I migrate to a new server.
“Anyone who has never made a mistake has never tried anything new.” - Albert Einstein
"If you are travelling at the speed of light and you turn on your headlights, would they work?" - Unknown

mcarson

  • I post occasionally
  • **
  • Posts: 110
  • Karma: 5
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7.x
  • MySQL version: 5.5
  • PHP version: 5.4.22
Re: Problem with imageUrl not displaying on contact view
October 06, 2011, 05:36:28 am
I have renewed our SSL certificate and checked that it was working. Cleared the Smarty cache and refreshed my page and found that the problem is still there.

Any ideas?

Opening the page source at the relevant line I see:
Code: [Select]
<a href="#" onClick="contactImagePopUp('http://domain.com/crm/sites/domain/files/civicrm/custom/image_6662989e0b352f93d601a0af6cd48991.jpg',,);">
            <img src="http://domain.com/crm/sites/domain/files/civicrm/custom/image_6662989e0b352f93d601a0af6cd48991.jpg" height = 100 width=100>

Using Chrome Developer Tools to modify the above code to have https instead of http displays the image (bit squashed though).

Also, in the drupal logs, the getimagesize function fails with a 404 not found (it's the wrong link)
« Last Edit: October 06, 2011, 05:38:32 am by mcarson »
“Anyone who has never made a mistake has never tried anything new.” - Albert Einstein
"If you are travelling at the speed of light and you turn on your headlights, would they work?" - Unknown

mcarson

  • I post occasionally
  • **
  • Posts: 110
  • Karma: 5
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7.x
  • MySQL version: 5.5
  • PHP version: 5.4.22
Re: Problem with imageUrl not displaying on contact view
October 06, 2011, 06:18:47 am
I was looking at the wrong code for how the image loads. doh!  :-[

Looking in CRM/Contact/Page/View.php on lines: 147-163 I noticed that the code changes the url from https to http then, if the Force Secure URLs is on, changes it back again. We have SSL enabled for the whole CiviCRM install, not just for the online contribution / member / event / admin pages. I never had this enabled in 3.3.5, so did not have any problems (with images uploaded over https, the others were changed in the db)

Had a look at CRM-7265 and this explains it. Turning on the option fixes it.
“Anyone who has never made a mistake has never tried anything new.” - Albert Einstein
"If you are travelling at the speed of light and you turn on your headlights, would they work?" - Unknown

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Problem with imageUrl not displaying on contact view

This forum was archived on 2017-11-26.