Closed ajaykayande1994 closed 2 months ago
From the docs it looks like the comment object is only available as an array element. Are you sure your code is contained by a for loop iterating over article.comments?
{% for comment in article.comments %}
{% # this is ok %}
{{ comment }}
{% endfor %}
{% # this is not ok %}
{{ comment }}
HI @charlespwd , please see this dawn theme, https://github.com/Shopify/dawn , you can clone the repo and find the warnings. My concern is who will fix this as we're using the file sections/main-article.liquid.
Either I misunderstand the paginate tag, or there's a missing for loop in there: https://github.com/Shopify/dawn/blob/main/sections/main-article.liquid#L106C11-L130C28
OK so just found out that this is indeed a documentation issue. We'll update our docs. The comment
object is available on pages with the comment form posted.
The docs are kind of obtuse, but we do have a reference to this happening here
Describe the bug
When I run commands "shopify theme check" in latest Shopify CLI >= 3.57.1, I am getting warning unknown object "comment" is used. Please fix this as we're targeting zero warnings for shopify theme check command.
Source
Expected behaviour
Warning should not be displayed for 'comment' object
Actual behaviour
Warning gets displayed as 'comment' object is unknown.
Debugging information
Additional context Add any other context about the problem here.