Skip to content

Commit

Permalink
feat(shs-5567): fix codeclimate issues
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorlj committed Apr 3, 2024
1 parent 13fd031 commit 41b19a2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions docroot/modules/humsci/hs_admin/hs_admin.module
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,15 @@ function hs_admin_field_widget_complete_paragraphs_browser_form_alter(&$field_wi
/**
* Implements hook_field_widget_complete_WIDGET_TYPE_form_alter().
*/
function hs_admin_field_widget_complete_menu_link_default_form_alter(array &$field_widget_complete_form, FormStateInterface $form_state, array $context) {
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_complete_form['widget']) as $key) {
if (!is_int($key) || !($field_widget_complete_form['widget'][$key]['expanded'] ?? FALSE)) {
foreach (Element::children($field_widget_form['widget']) as $key) {
if (!is_int($key) || !($field_widget_form['widget'][$key]['expanded'] ?? FALSE)) {
continue;
} else {
}
else {
// Disable access to `expanded` checbox.
$field_widget_complete_form['widget'][$key]['expanded']['#access'] = FALSE;
$field_widget_form['widget'][$key]['expanded']['#access'] = FALSE;
break;
}
}
Expand Down

0 comments on commit 41b19a2

Please sign in to comment.