verbb / comments

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

Avatar will not render (Reopening as a Bug Report) #264

Closed mitchellgemma closed 1 year ago

mitchellgemma commented 1 year ago

Describe the bug

When calling {{ craft.comments.render(entry.id) }} and using the default template, the photos for users do not render properly. In the src for the photo, it only says the file name, and does not include the path to the file. Also, when trying to select a default user photo in the Craft admin panel, no existing pictures load and I am told a server error has occured.

Steps to reproduce

  1. Any new comments from different users still do not render

Craft CMS version

4.2.5.1

Plugin version

2.0.2.1

Multi-site?

No

Additional context

image

Here are the volume settings that are configured for the 'User Photo Location'

mitchellgemma commented 1 year ago

For anyone experiencing a similar issue, here is the code I used to fix this issue. Reach out if you have any additional questions!

{% if comment.can('showAvatar') %}

{% set avatar = comment.author.getPhoto() %} {% if avatar %} {% if avatar is iterable %} {% else %} {% endif %} {% else %} {% endif %}

{% endif %}

Hope this helps someone!

engram-design commented 1 year ago

Should be fixed for the next release. To get this early, change your verbb/comments requirement in composer.json to:

"require": {
  "verbb/comments": "dev-craft-4 as 2.0.2.1",
  "...": "..."
}

Then run composer update.

engram-design commented 1 year ago

Fixed in 2.0.3