Skip to content
Snippets Groups Projects
Commit 4367211e authored by Vince Tikász's avatar Vince Tikász Committed by Sascha Eggenberger
Browse files

Resolve #3486743 "Cannot opt out"

parent 40c4bd2b
No related branches found
No related tags found
1 merge request!228Issue #3342164: Remove implicit dependency on node module for gin content form
......@@ -62,6 +62,10 @@ function gin_form_after_build(array $form, FormStateInterface $form_state): arra
foreach (Element::children($form['actions']) as $key) {
$button = $form['actions'][$key];
if (!($button['#access'] ?? TRUE)) {
continue;
}
if (isset($button['#type']) && $button['#type'] === 'submit') {
$button_classes = isset($button['#attributes']['class']) && is_array($button['#attributes']['class']) ? $button['#attributes']['class'] : [];
$button_type_class = isset($button['#button_type']) ? "button--{$button['#button_type']}" : NULL;
......@@ -89,7 +93,7 @@ function gin_form_after_build(array $form, FormStateInterface $form_state): arra
];
// Add the label to the form actions array.
if (in_array($key, $includes, TRUE)) {
if (in_array($key, $includes, TRUE) || !empty($button['#gin_action_item'])) {
$form['gin_sticky_actions']['actions'][$key] = $new_label;
}
// Add to more menu.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment