[CONTROLLER][Actor] Handle case where there isn't a logged in user
This commit is contained in:
parent
4b98200ecd
commit
67f09d4e50
|
@ -130,7 +130,7 @@ class Actor extends ActorController
|
|||
}
|
||||
}
|
||||
|
||||
$notes = DB::dql(
|
||||
$notes = !\is_null($group) ? DB::dql(
|
||||
<<<'EOF'
|
||||
select n from note n
|
||||
join activity a with n.id = a.object_id
|
||||
|
@ -138,12 +138,12 @@ class Actor extends ActorController
|
|||
where a.object_type = 'note' and gi.group_id = :group_id
|
||||
EOF,
|
||||
['group_id' => $group->getId()],
|
||||
);
|
||||
) : [];
|
||||
|
||||
return [
|
||||
'_template' => 'actor/group_view.html.twig',
|
||||
'actor' => $group,
|
||||
'nickname' => $group->getNickname(),
|
||||
'nickname' => $group?->getNickname() ?? $nickname,
|
||||
'notes' => $notes,
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
{% extends 'stdgrid.html.twig' %}
|
||||
{% import '/cards/note/view.html.twig' as noteView %}
|
||||
|
||||
|
||||
|
||||
{% set nickname = nickname|escape %}
|
||||
{% block title %}{{ nickname }}{% endblock %}
|
||||
|
||||
{% block stylesheets %}
|
||||
|
@ -38,8 +37,11 @@
|
|||
|
||||
{% else %}
|
||||
<div class="section-widget-padded section-widget">
|
||||
<p>{% trans with { '%group%': nickname } %}The group <em>%group%</em> doesn't exist. Would you like to create it?{% endtrans %}</p>
|
||||
<p>{% trans with { '%group%': nickname } %}The group <em>%group%</em> doesn't exist.{% endtrans %}</p>
|
||||
{% if create_form is defined and create_form is not null %}
|
||||
<p>{% trans %}Would you like to create it?{% endtrans %}</p>
|
||||
{{ form(create_form) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock body %}
|
||||
|
|
Loading…
Reference in New Issue
Block a user