diff --git a/templates/parts/edit/edit_form_styles.html.twig b/templates/parts/edit/edit_form_styles.html.twig index 993e1fb7..765f200c 100644 --- a/templates/parts/edit/edit_form_styles.html.twig +++ b/templates/parts/edit/edit_form_styles.html.twig @@ -189,8 +189,9 @@ {% endif %} - {% if attach.secure and not is_granted('show_private', attach) %} - {# Leave blank #} + {% if attach.secure and (not is_granted('show_private', attach) or attach.id is null) %} + {# Leave blank: either the user is not allowed to see private attachments, or the attachment + (e.g. from a cloned part) has not been saved yet, so no view URL can be generated for it #} {% elseif attach.picture %} {% trans %}attachment.preview.alt{% endtrans %}