Bläddra i källkod

Merge pull request #354 from jeremyFreeAgent/fix_no_delete_route

Fixed an issue when there is not delete route
Thomas 13 år sedan
förälder
incheckning
1a20b9a7d4
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1 1
      Resources/views/CRUD/base_edit.html.twig

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

@@ -88,7 +88,7 @@ file that was distributed with this source code.
                     <input type="submit" name="btn_update_and_edit" value="{% trans from 'SonataAdminBundle' %}btn_update_and_edit_again{% endtrans %}"/>
                     <input type="submit" name="btn_update_and_list" value="{% trans from 'SonataAdminBundle' %}btn_update_and_return_to_list{% endtrans %}"/>
 
-                    {% if admin.isGranted('DELETE') %}
+                    {% if admin.hasroute('delete') and admin.isGranted('DELETE') %}
                         <a href="{{ admin.generateObjectUrl('delete', object) }}">{% trans from 'SonataAdminBundle' %}link_delete{% endtrans %}</a>
                     {% endif %}
                 {% else %}