[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'
|
<<<'EOF'
|
||||||
select n from note n
|
select n from note n
|
||||||
join activity a with n.id = a.object_id
|
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
|
where a.object_type = 'note' and gi.group_id = :group_id
|
||||||
EOF,
|
EOF,
|
||||||
['group_id' => $group->getId()],
|
['group_id' => $group->getId()],
|
||||||
);
|
) : [];
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'_template' => 'actor/group_view.html.twig',
|
'_template' => 'actor/group_view.html.twig',
|
||||||
'actor' => $group,
|
'actor' => $group,
|
||||||
'nickname' => $group->getNickname(),
|
'nickname' => $group?->getNickname() ?? $nickname,
|
||||||
'notes' => $notes,
|
'notes' => $notes,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
{% extends 'stdgrid.html.twig' %}
|
{% extends 'stdgrid.html.twig' %}
|
||||||
{% import '/cards/note/view.html.twig' as noteView %}
|
{% import '/cards/note/view.html.twig' as noteView %}
|
||||||
|
|
||||||
|
{% set nickname = nickname|escape %}
|
||||||
|
|
||||||
{% block title %}{{ nickname }}{% endblock %}
|
{% block title %}{{ nickname }}{% endblock %}
|
||||||
|
|
||||||
{% block stylesheets %}
|
{% block stylesheets %}
|
||||||
|
@ -38,8 +37,11 @@
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="section-widget-padded section-widget">
|
<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>
|
||||||
{{ form(create_form) }}
|
{% 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>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock body %}
|
{% endblock body %}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user