ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Suddenly problem with member photos

November 29, 2011 3:54am

Subscribe [4]
  • #1 / Nov 29, 2011 3:54am

    huulbaek

    71 posts

    I have used member photos for some time now for displaying them in channel entries and comment entries. Everything has worked fine but today they are no longer displayed all of a sudden.

    I think it happened after I changed the URL to member photos to https instead of http - but that is the only change I made.

    The photos are displayed if the user is logged out. For example, this page will work if you are not logged in:

    http://www.parlamentet.dk/site/artikel/delegering_af_din_stemmerettighed

    If I am logged in the if photo fails and I have also tried getting the photo_url without a conditional - nothing is fetched. The code in the template is:

    {if photo}
    {photo_url}
    {/if}

    I have cleared the caches to no avail. And I have changed it back to http from https but nothing changes.

  • #2 / Nov 29, 2011 3:58am

    huulbaek

    71 posts

    I’m using latest build and the photos work in CP.

  • #3 / Nov 30, 2011 2:54am

    John Henry Donovan

    12339 posts

    Hi huulbaek,

    Can I ask why you are adding https just to the member photos?

    What version and build of EE are you using?

    If you make the URL to member photos relative what happens?

    /images/member_photos/
  • #4 / Nov 30, 2011 3:16am

    huulbaek

    71 posts

    Hi John,

    I’m adding https to the member photos because comments on certain pages that contain member photos need SSL.

    EE is version 2.3.1, build 20111017.

    It’s the same problem if I use the relative path - it’s the same problem no matter what I do now. I can’t think how this could happen; especially I find it very strange that it works when I’m not logged ind.

  • #5 / Dec 02, 2011 2:12am

    huulbaek

    71 posts

    Nothing else I can try?

  • #6 / Dec 05, 2011 5:07am

    John Henry Donovan

    12339 posts

    Hi huulbaek,

    Can you confirm if your Comments tags are nested in your Channel Entries tag or placed outside them?

    Can you show us some more example template code so we can try and replicate this please?

  • #7 / Dec 05, 2011 5:57am

    huulbaek

    71 posts

    Well, yes, I can confirm that. But it doesn’t only happen in the comment tags - also in the channel entries tag. The following tag produces the correct photo of the author if the user is not logged in - but nothing is rendered if a user is logged ind:

    {if photo}
    {photo_url}
    {/if}
  • #8 / Dec 06, 2011 11:21pm

    Dan Decker

    7338 posts

    Hi huulbaek,

    Are you able to access the images via https directly? For example:

    <a href="https://example.com/path/to/image.jpg">https://example.com/path/to/image.jpg</a>

    Are all of your src attributes on the template being forced to use https? I’m wondering if the issue might be related to the page tying to pull some assets via standard http. What method are you using to force https on your templates?

    Thanks!

  • #9 / Dec 07, 2011 2:57am

    huulbaek

    71 posts

    Yes, I can access them via https with no trouble. Also, the images are rendered if you visit the site as a guest. The problem only appears when you log in.

    I use .htaccess to force https on some URLs.

  • #10 / Dec 08, 2011 3:15pm

    Dan Decker

    7338 posts

    Once you have your members login, are they kept in https until they log out? Can you login to the site and then copy the rendered html here so we can have a look at the output of template that’s being affected?

  • #11 / Dec 09, 2011 2:26am

    huulbaek

    71 posts

    Just yesterday I made the entire site forced https.

    Well, what is rendered is simply the photo (if you are not logged in):

    /images/member_photos/photo_2.png

    And if logged in the conditional if photo fails. When not using the condition, the following is rendered:

    " width=

    So, it is only stuff related to the photo that isn’t fetched and rendered. The abose is from the channel entries tag.

  • #12 / Dec 12, 2011 2:15pm

    Dan Decker

    7338 posts

    Hi huulbaek,

    Ok, I did some digging.

    You can try this… Open your /system/expressionengine/config/config.php and near line 24, add:

    if ($_SERVER['HTTPS'] == "on")
    { 
      $config['photo_url'] = 'https://your.domain.com/images/member_photos/';
    }

    That will conditionally set the photo_url to use https if it detects it in use on the server. Let me know if that gets this working properly.

    Thanks!

  • #13 / Dec 12, 2011 2:27pm

    Dan Decker

    7338 posts

    If you are interested in a more comprehensive solution that adjusts based on the server environment, you might have a look at Multi-server Set-up on EE Insider. It goes pretty in-depth, but would cover all your bases in this scenario.

    Cheers!

  • #14 / Dec 13, 2011 3:26am

    huulbaek

    71 posts

    Good try, Dan 😊 Unfortunately, it makes no difference. Still photos work fine everywhere on the site when not logged in.

    Also, they work fine when logged in when I use them in the exp:user tag from Solspace User module.

    But what does the

    if {photo}

    check against? Isn’t it a lookup in the database? I have no idea how it can fail when a user is logged in.

  • #15 / Dec 14, 2011 4:46pm

    Dan Decker

    7338 posts

    huulbaek,

    {if photo} isn’t so much a database check, but just checks to see if photo information was returned with the member’s information.

    At this point, I’m stumped. I’m going to ping our developers on this to see if there is any insight.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases