Skip to content

Commit

Permalink
Check if EntryComment is defined and not null...?EntryComment can be …
Browse files Browse the repository at this point in the history
…null after all during the __invoke
  • Loading branch information
melroy89 committed Sep 13, 2024
1 parent 4d930f6 commit 5322898
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions templates/entry/comment/view.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,20 @@
</div>
{% set autoAction = 'notifications:EntryCommentCreatedNotification@window->subject-list#addComment' %}
{% set manualAction = 'notifications:EntryCommentCreatedNotification@window->subject-list#increaseCounter' %}
<div class="{{ html_classes('comments entry-comments comments-tree', {
'show-comment-avatar' : SHOW_COMMENT_USER_AVATARS is same as V_TRUE
}) }}"
data-controller="subject-list"
data-action="{{- DYNAMIC_LISTS is same as V_TRUE ? autoAction : manualAction -}}">
{{ component('entry_comment', {
comment: comment.root ?? comment,
showEntryTitle: false,
showMagazineName: false,
showNested: true,
}) }}
</div>

{% set entryComment = comment.root ?? comment %}
{% if entryComment is defined and entryComment is not null %}
<div class="{{ html_classes('comments entry-comments comments-tree', {
'show-comment-avatar' : SHOW_COMMENT_USER_AVATARS is same as V_TRUE
}) }}"
data-controller="subject-list"
data-action="{{- DYNAMIC_LISTS is same as V_TRUE ? autoAction : manualAction -}}">
{{ component('entry_comment', {
comment: entryComment,
showEntryTitle: false,
showMagazineName: false,
showNested: true,
}) }}
</div>
{% endif %}
{% endblock %}

0 comments on commit 5322898

Please sign in to comment.