Quellcode durchsuchen

Check whether there is actually something to diplay for 'view' before displaying the button

Pascal Burkhard vor 14 Jahren
Ursprung
Commit
8b49d08265
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      Resources/views/CRUD/base_edit.html.twig

+ 1 - 1
Resources/views/CRUD/base_edit.html.twig

@@ -14,7 +14,7 @@ file that was distributed with this source code.
 {% block actions %}
     <div class="sonata-actions">
         <ul>
-            {% if admin.id(object) and admin.isGranted('VIEW')%}
+            {% if admin.id(object) and admin.isGranted('VIEW') and admin.getViewFieldDescriptions is not empty %}
                 <li class="sonata-action-element"><a href="{{ admin.generateUrl('view', {'id' : admin.id(object)}) }}">{% trans from 'SonataAdminBundle' %}link_action_view{% endtrans %}</a></li>
             {% endif %}
             {% if admin.isGranted('CREATE')%}