From 9808ba4f5cb71d483a1ee7dd19c3d7b6d23386ef Mon Sep 17 00:00:00 2001 From: ADmad Date: Wed, 23 Sep 2020 00:24:14 +0530 Subject: [PATCH] By default add form tags no non-GET action links into "action_link_forms" block. This avoid nested forms. --- templates/element/actions.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/templates/element/actions.php b/templates/element/actions.php index 5f1d425..5751101 100644 --- a/templates/element/actions.php +++ b/templates/element/actions.php @@ -25,6 +25,7 @@ if ($config['method'] !== 'GET') { $linkOptions += [ 'method' => $config['method'], + 'block' => 'action_link_forms', ]; } @@ -33,6 +34,11 @@ unset($config['callback']); $config['options'] = $linkOptions; $links[$name] = $callback($config, !empty($singularVar) ? $singularVar : null, $this); + + if ($links[$name]['method'] !== 'GET' && !isset($links[$name]['options']['block'])) { + $links[$name]['options']['block'] = 'action_link_forms'; + } + continue; }