verbb / comments

A Craft CMS plugin for managing comments directly within the CMS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Avatar not shown

lucosius opened this issue · comments

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

Likely duplicate of #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?

I fixed this problem with changing avatar query to this:

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

Closing in favour of #264