From eb124ccb1fe79bfb8e2b511a80d267696253ab3f Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 12 May 2018 18:19:44 -0400 Subject: [PATCH] feat: do not display the Delete button on anything but the EditAction --- docs/_partials/pages/form/submit-buttons.rst | 2 +- src/Listener/Traits/FormTypeTrait.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/_partials/pages/form/submit-buttons.rst b/docs/_partials/pages/form/submit-buttons.rst index 9cfee4ba..b161026f 100644 --- a/docs/_partials/pages/form/submit-buttons.rst +++ b/docs/_partials/pages/form/submit-buttons.rst @@ -64,7 +64,7 @@ By default, extra buttons appear on the right-hand side of forms. The left-hand is managed separately, and will show the following by default - Delete: An embedded postLink for deleting the current entity. This only appears on the - pages that are not rendered via ``AddAction``. + pages that are rendered via ``EditAction``. To use the defaults, you may either omit the configuration key **or** set it diff --git a/src/Listener/Traits/FormTypeTrait.php b/src/Listener/Traits/FormTypeTrait.php index 8128b4b7..f966a13f 100644 --- a/src/Listener/Traits/FormTypeTrait.php +++ b/src/Listener/Traits/FormTypeTrait.php @@ -1,7 +1,7 @@ _action(); - if (!($action instanceof AddAction)) { + if ($action instanceof EditAction) { $buttons[] = [ 'title' => __d('crud', 'Delete'), 'url' => ['action' => 'delete'],