Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if EntryComment is defined and not null #1129

Merged
merged 6 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions templates/entry/comment/view.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,23 @@
}) }}"
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,
}) }}
{% set entryComment = comment.root ?? comment %}
{% if entryComment is defined and entryComment is not null %}
{{ component('entry_comment', {
comment: entryComment,
showEntryTitle: false,
showMagazineName: false,
showNested: true,
}) }}
{% else %}
<div class="section alert alert__danger">
<p>
<a href="{{ entry_url(entry) }}" class="btn btn-link btn__danger">
<i class="fa-solid fa-arrow-left-long" title="{{ 'back'|trans }}"></i> {{ 'back'|trans }}
</a>
&nbsp; {{ 'comment_not_found'|trans }}
melroy89 marked this conversation as resolved.
Show resolved Hide resolved
</p>
</div>
{% endif %}
</div>
{% endblock %}
1 change: 1 addition & 0 deletions translations/messages.en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -896,3 +896,4 @@ admin_users_suspended: Suspended
admin_users_banned: Banned
user_verify: Activate account
max_image_size: Maximum file size
comment_not_found: Comment not found
Loading