Skip to content

Commit

Permalink
By default add form tags no non-GET action links into "action_link_fo…
Browse files Browse the repository at this point in the history
…rms" block.

This avoid nested forms.
  • Loading branch information
ADmad committed Sep 22, 2020
1 parent cde428e commit 9808ba4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions templates/element/actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
if ($config['method'] !== 'GET') {
$linkOptions += [
'method' => $config['method'],
'block' => 'action_link_forms',
];
}

Expand All @@ -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;
}

Expand Down

0 comments on commit 9808ba4

Please sign in to comment.