Skip to main content
3 of 3
added 67 characters in body
Brad Bell
  • 67.6k
  • 6
  • 75
  • 145

Why does {{ user.getPhotoUrl(64) }} point towards storage/runtime and not to storage/userprofiles?

I am trying to load user profile pictures (the Craft ones), but they don't load. The getPhotoUrl() seems to point to the wrong folder(?).

The profile images seem to be stored in the userprofiles folder by default

{% set users = craft.users %}

{% for user in users %}
    <div class="searchresults"><a href="/profile/{{ user }}">{{ user }}</a>

    {% if user.getPhotoUrl %}
        <img src="{{ user.getPhotoUrl(64) }}" class="profile_search_picture" alt="{{ entry.user.getFullName }}"/>
    {% else %}
        <img src="/img/fallback.png" class="profile_search_picture" alt="{{ entry.user.getFullName }}"/> 
    {% endif %}
    
</div>
{% endfor %}

2017/04/24 11:24:10 [error] [application] Tried to read the folder contents of /Applications/MAMP/htdocs/craft/storage/runtime/assets/sources/, but could not. 2017/04/24 11:24:10 [error] [application] Tried to read the folder contents of /Applications/MAMP/htdocs/craft/storage/runtime/assets/tempuploads/field_3/, but could not. 2017/04/24 11:24:10 [error] [application] Tried to read the folder contents of /Applications/MAMP/htdocs/craft/storage/runtime/assets/tempuploads/field_4/, but could not. 2017/04/24 11:24:10 [error] [application] Tried to read the folder contents of /Applications/MAMP/htdocs/craft/storage/runtime/assets/tempuploads/user_1/field_3/, but could not. 2017/04/24 11:24:10 [error] [application] Tried to read the folder contents of /Applications/MAMP/htdocs/craft/storage/runtime/assets/tempuploads/user_1/field_4/, but could not. 2017/04/24 11:24:10 [error] [application] Tried to read the folder contents of /Applications/MAMP/htdocs/craft/storage/runtime/temp/uploads/userphotos/harry/, but could not. 2017/04/24 11:24:10 [error] [application] Tried to read the folder contents of /Applications/MAMP/htdocs/craft/storage/runtime/temp/uploads/userphotos/remco/, but could not.


the console gives this error

GET http://localhost/cpresources/userphotos/remco/64/17492405_10212330524487585_7776812525773615973_o.jpg?x=UoEZXg1dH net::ERR_CONNECTION_REFUSED
Remco
  • 143
  • 6