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) »
  • Contact Image not appearing
Pages: [1]

Author Topic: Contact Image not appearing  (Read 932 times)

brentdec

  • I’m new here
  • *
  • Posts: 1
  • Karma: 0
  • CiviCRM version: 4.4.6
  • CMS version: Drupal 7.28
  • MySQL version: X
  • PHP version: X
Contact Image not appearing
July 04, 2014, 12:12:10 am
I recently tried to include images for my contacts.

I am logged in as an administrator.

The image uploads to the server fine - it's where it's supposed to be. However, when the page refreshes, I get the following error message:

Warning: getimagesize(http://www.wsfaonline.org/index.php?q=civicrm/contact/imagefile&photo=15058_99e50b754c646a45e55b48056e164db0.jpg) [function.getimagesize]: failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in CRM_Contact_Page_View->preProcess() (line 170 of /home/decdigital/www/www/sites/all/modules/civicrm/CRM/Contact/Page/View.php).

Where the image is suppose to be, there is an question mark.

I upgraded CiviCRM to 4.4.6, and the problem persists. How do I fix this?

Wes Reimer

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 1
  • CiviCRM version: 4.4.6
  • CMS version: WordPress 3.9.x
  • MySQL version: 5.5.36-cll
  • PHP version: 5.3.27
Re: Contact Image not appearing
July 10, 2014, 10:07:50 am
Contact images also fail for me after upgrading to 4.4.6, but I think my issue is different and only affects WordPress. See https://issues.civicrm.org/jira/browse/CRM-14971.

Wes Reimer

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 1
  • CiviCRM version: 4.4.6
  • CMS version: WordPress 3.9.x
  • MySQL version: 5.5.36-cll
  • PHP version: 5.3.27
Re: Contact Image not appearing
July 10, 2014, 11:11:18 am
As I noted in the Issue Tracker, this can be fixed in WordPress by adding the condition referencing 'imagefile' to the file /public_html/wp-content/plugins/civicrm/civicrm.php (insert that line at line 423):

Code: [Select]
    if (CRM_Utils_Array::value('HTTP_X_REQUESTED_WITH', $_SERVER) == 'XMLHttpRequest'
        || ($args[0] == 'civicrm' && in_array($args[1], array('ajax', 'file')) )
        || !empty($_REQUEST['snippet'])
        || strpos($argString, 'civicrm/event/ical') === 0 && empty($_GET['html'])
        || strpos($argString, 'civicrm/contact/imagefile') === 0
      ) {
      return FALSE;
« Last Edit: July 10, 2014, 11:14:53 am by Wes Reimer »

Wes Reimer

  • I post occasionally
  • **
  • Posts: 49
  • Karma: 1
  • CiviCRM version: 4.4.6
  • CMS version: WordPress 3.9.x
  • MySQL version: 5.5.36-cll
  • PHP version: 5.3.27
Re: Contact Image not appearing
July 15, 2014, 10:39:49 am
Brent, check the issue link. There is now another fix specific to getimagesize() which may address your issue. Specifically, it fails because of escaped ampersands in URLs, so the patch replaces "&" with "&".
« Last Edit: July 15, 2014, 10:41:27 am by Wes Reimer »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Upgrading CiviCRM (Moderator: Deepak Srivastava) »
  • Contact Image not appearing

This forum was archived on 2017-11-26.