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 »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Images uploaded for inclusion in PCP pages don't display in the browser
Pages: [1]

Author Topic: Images uploaded for inclusion in PCP pages don't display in the browser  (Read 942 times)

jursulak

  • I’m new here
  • *
  • Posts: 7
  • Karma: 3
  • CiviCRM version: 4.5.6
  • CMS version: Wordpress 4.1.1
Images uploaded for inclusion in PCP pages don't display in the browser
March 09, 2015, 04:05:28 pm
Hi—

I have CiviCRM 4.5.6 running in Wordpress 4.1.1

I have Personal Campaign Pages setup for an event. Users were able to upload images to include on their PCPs, and they were working, however they now no longer showing up.

I have attached a screen shot. Here is a link to one of the pages: https://www.thewellspringfoundation.org/base/?page=CiviCRM&q=civicrm/pcp/info&reset=1&id=17

I've searched the forum and internet for any know issues or fixes and did find this addressing same (at least it sounds the same issue) in 4.3.x: http://forum.civicrm.org/index.php/topic,25709.msg125238.html#msg125238, however it looks like it was patched for 4.3.5: https://issues.civicrm.org/jira/browse/CRM-12977

A bit more info:
I do have a couple of extensions installed:
  • CiviCRM PCP Teams: https://github.com/mlutfy/ca.bidon.pcpteams
  • CiviDiscount: https://civicrm.org/extensions/cividiscount-extension
  • iATS Payment Processor: https://civicrm.org/extensions/iats-payments

I also changed my WordPress Base Page in Administer > System Settings > CMS Database Integration

Does anyone have any insight?

Thanks in advance,
Jayson

mathieu

  • Administrator
  • Ask me questions
  • *****
  • Posts: 620
  • Karma: 36
    • Work
  • CiviCRM version: 4.7
  • CMS version: Drupal
  • MySQL version: MariaDB 10
  • PHP version: 7
Re: Images uploaded for inclusion in PCP pages don't display in the browser
March 10, 2015, 11:33:04 am
Hi,

By any chance, do you have access to your Apache error logs? I wonder if you have a "headers have already been sent" warning message. On Linux with Apache, those logs are usually in /var/log/apache2/error.log.

Unrelated: you should ask your hosting provider to disable RC4 in your https/SSL configuration.

For example, in Apache:

Code: [Select]
SSLProtocol all -SSLv2 -SSLv3
SSLHonorCipherOrder on
SSLCipherSuite "ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:kDHE:SHA256:EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:HIGH:!RC4:!MD5:!DSS:!SRP:!LOW:!3DESL:!EXP:!PSK:!SRP:!aNULL:!eNULL:!NULL"

References:
https://www.ssllabs.com/ssltest/
https://github.com/coopsymbiotic/httpstools/blob/master/README.md

Mathieu
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

jursulak

  • I’m new here
  • *
  • Posts: 7
  • Karma: 3
  • CiviCRM version: 4.5.6
  • CMS version: Wordpress 4.1.1
Re: Images uploaded for inclusion in PCP pages don't display in the browser
March 10, 2015, 01:19:23 pm
Hi Mathieu—

I am on Shared Pro Hosting at HostMonster.com. I have access to error logs, however the only errors I see for today are:

PHP Warning:  Invalid argument supplied for foreach() in /home1/thewells/public_html/wp-content/plugins/files/civicrm/custom_ext/ca.bidon.pcpteams-master/pcpteams.inc.php on line 262

I see that Contact photos are also doing the same thing as PCP photos.

When I download the images from the website (pcp or contact images) I am unable to open them as they are invalid. I open them with a text editor and see that they begin with 'two "newlines" (blank lines) at the beginning. as you mentioned in your reply to my email earlier today. When I remove those blank lines it becomes a valid jpeg and I can open. The same happens for .png files.

I have upgraded to 4.5.8 and the issues still exists.

jursulak

  • I’m new here
  • *
  • Posts: 7
  • Karma: 3
  • CiviCRM version: 4.5.6
  • CMS version: Wordpress 4.1.1
Re: Images uploaded for inclusion in PCP pages don't display in the browser
March 10, 2015, 01:52:09 pm
When inspecting the image in Chrome Developer Tools I can change the path to the image file and it will show up.

For example when viewing my contact record the image doesn't show up, when I inspect it in Developer Tools I see it's url as https://www.thewellspringfoundation.org/base?page=CiviCRM&q=civicrm/contact/imagefile&photo=jayson_27972dfc4e3ac6540aa76f102a64d31a.jpg

However, when I change the url in Developer Tools to http://thewellspringfoundation.org/wp-content/plugins/files/civicrm/custom/jayson_c5c4f4d6087f0e0adc7150ae441bcb81.jpg it works.

I can (of course) do the same thing for images included in PCPs.

mathieu

  • Administrator
  • Ask me questions
  • *****
  • Posts: 620
  • Karma: 36
    • Work
  • CiviCRM version: 4.7
  • CMS version: Drupal
  • MySQL version: MariaDB 10
  • PHP version: 7
Re: Images uploaded for inclusion in PCP pages don't display in the browser
March 10, 2015, 02:36:17 pm
I'm pretty sure the bug is in your Wordpress theme, since we can see the newlines at the beginning of non-CiviCRM pages, for example:
https://www.thewellspringfoundation.org/stories/

When we do "new source" on the page, it starts with two blank lines as well.

I would not recommend changing the URLs of images, since they're supposed to go through CiviCRM for access-control purposes. (I think those directories are not supposed to be accessible directly? ex: for contact record images in particular)
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

jursulak

  • I’m new here
  • *
  • Posts: 7
  • Karma: 3
  • CiviCRM version: 4.5.6
  • CMS version: Wordpress 4.1.1
Re: Images uploaded for inclusion in PCP pages don't display in the browser
March 10, 2015, 02:47:00 pm
Mathieu! Thanks, it's my theme. I've switched to the Wordpress Twenty Fifteen them and the photos show up.

Now to figure out why it's happening in my custom theme…

Thanks Mathieu, I really appreciate your help.

mathieu

  • Administrator
  • Ask me questions
  • *****
  • Posts: 620
  • Karma: 36
    • Work
  • CiviCRM version: 4.7
  • CMS version: Drupal
  • MySQL version: MariaDB 10
  • PHP version: 7
Re: Images uploaded for inclusion in PCP pages don't display in the browser
March 10, 2015, 03:11:39 pm
There is probably a PHP file looking like this:

Code: [Select]


<?php
  
// stuff here, after newlines above

Although I don't really know of a quick way to scan and find that easily on the command line, other than inspecting files manually.

The closest I can think of is:

Code: [Select]
find /path/to/wordpress/theme/ -type f | xargs --verbose -n 1 head -1 | grep '^[[:space:]]*$'

Good luck :)
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

jursulak

  • I’m new here
  • *
  • Posts: 7
  • Karma: 3
  • CiviCRM version: 4.5.6
  • CMS version: Wordpress 4.1.1
Re: Images uploaded for inclusion in PCP pages don't display in the browser
March 16, 2015, 09:09:12 pm
Hey Mathieu—

Turns out it was a plugin I had install called Archive. I've deactivated it and all seems to be working now.

mathieu

  • Administrator
  • Ask me questions
  • *****
  • Posts: 620
  • Karma: 36
    • Work
  • CiviCRM version: 4.7
  • CMS version: Drupal
  • MySQL version: MariaDB 10
  • PHP version: 7
Re: Images uploaded for inclusion in PCP pages don't display in the browser
March 18, 2015, 04:48:41 am
Thanks for sharing the solution! Glad you found the issue.

Mathieu
CiviCamp Montréal, 29 septembre 2017 | Co-founder / consultant / turn-key CiviCRM hosting for Quebec/Canada @ SymbioTIC.coop

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Images uploaded for inclusion in PCP pages don't display in the browser

This forum was archived on 2017-11-26.