verbb / comments

A Craft CMS plugin for managing comments directly within the CMS.
Other
137 stars 33 forks source link

Avatar not shown #263

Closed lucosius closed 1 year ago

lucosius commented 1 year ago

Question

Hello,

After upgrading to CraftCMS 4 - the user avatar is not being displayed... In the source code I can see that URL is not set into img tag.

I have this code to get avatar url:


    {% if comment.can('showAvatar') %}
     {% set avatar = comment.getAvatar() %}
     <div class="comment-item-userpic">
         {% if avatar %}
                    <img src="{{ avatar.url({ width: 65, height: 65, mode: 'fit' }) }}" class="image-cover"/>
                {% else %}
                    <img src="https://telefonai.eu/avatar.jpeg" class="image-cover"/>
                {% endif %}
                                            </div>
    {% endif %}

System can see if avatar exist but cannot put URL. What can be wrong here?

Additional context

No response

engram-design commented 1 year ago

Likely duplicate of https://github.com/verbb/comments/issues/261 which again, this should've been created as a Bug Report issue, not a question.

What are your asset volume/filesystem settings? What does a {% dd avatar %} produce just above the <img> tag?

lucosius commented 1 year ago

I fixed this problem with changing avatar query to this:

{% set avatar = comment.author.getPhoto() %}

engram-design commented 1 year ago

Closing in favour of https://github.com/verbb/comments/issues/264