Skip to content
Snippets Groups Projects

Resolve #3486743 "Cannot opt out"

Merged Vince Tikász requested to merge issue/gin-3486743:3486743-cannot-opt-out into 8.x-3.x
1 file
+ 5
1
Compare changes
  • Side-by-side
  • Inline
+ 5
1
@@ -62,6 +62,10 @@ function gin_form_after_build(array $form, FormStateInterface $form_state): arra
@@ -62,6 +62,10 @@ function gin_form_after_build(array $form, FormStateInterface $form_state): arra
foreach (Element::children($form['actions']) as $key) {
foreach (Element::children($form['actions']) as $key) {
$button = $form['actions'][$key];
$button = $form['actions'][$key];
 
if (!($button['#access'] ?? TRUE)) {
 
continue;
 
}
 
if (isset($button['#type']) && $button['#type'] === 'submit') {
if (isset($button['#type']) && $button['#type'] === 'submit') {
$button_classes = isset($button['#attributes']['class']) && is_array($button['#attributes']['class']) ? $button['#attributes']['class'] : [];
$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;
$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
@@ -89,7 +93,7 @@ function gin_form_after_build(array $form, FormStateInterface $form_state): arra
];
];
// Add the label to the form actions array.
// 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;
$form['gin_sticky_actions']['actions'][$key] = $new_label;
}
}
// Add to more menu.
// Add to more menu.
Loading