Skip to content

Commit

Permalink
fix(shs-5567): minor fix in menu link expanded form alter
Browse files Browse the repository at this point in the history
  • Loading branch information
cienvaras committed Apr 3, 2024
1 parent bea2160 commit 016888e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions docroot/modules/humsci/hs_admin/hs_admin.module
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,11 @@ function hs_admin_field_widget_complete_paragraphs_browser_form_alter(&$field_wi
function hs_admin_field_widget_complete_menu_link_default_form_alter(array &$field_widget_form, FormStateInterface $form_state, array $context) {
// Go through each widget element.
foreach (Element::children($field_widget_form['widget']) as $key) {
if (!is_int($key) || !($field_widget_form['widget'][$key]['expanded'] ?? FALSE)) {
if (!is_int($key) || !isset($field_widget_form['widget'][$key]['expanded'])) {
continue;
}
else {
// Disable access to `expanded` checbox.
$field_widget_form['widget'][$key]['expanded']['#access'] = FALSE;
break;
}
// Disable access to `expanded` checkbox.
$field_widget_form['widget'][$key]['expanded']['#access'] = FALSE;
break;
}
}

0 comments on commit 016888e

Please sign in to comment.