Skip to content

Commit

Permalink
Merge pull request #1134 from UN-OCHA/berliner/fix-warnings
Browse files Browse the repository at this point in the history
Fix some warnings
  • Loading branch information
berliner authored Oct 17, 2024
2 parents f3553a6 + 3f8b18e commit 939fd11
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions html/modules/custom/ghi_plans/ghi_plans.module
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,15 @@ function ghi_plans_form_base_object_plan_edit_form_alter(&$form, FormStateInterf

// Display disabled select dropdowns as simple textfields.
foreach (Element::children($form) as $element_key) {
if (empty($form[$element_key]['#disabled']) || $form[$element_key]['widget']['#type'] != 'select') {
if (empty($form[$element_key]['#disabled']) || ($form[$element_key]['widget']['#type'] ?? NULL) != 'select') {
continue;
}
$default = $form[$element_key]['widget']['#default_value'];
$form[$element_key]['widget']['#access'] = FALSE;
$form[$element_key]['summary'] = [
'#type' => 'textfield',
'#title' => $form[$element_key]['widget']['#title'],
'#default_value' => $form[$element_key]['widget']['#options'][$form[$element_key]['widget']['#default_value'][0]],
'#default_value' => !empty($default) ? $form[$element_key]['widget']['#options'][array_shift($default)] : NULL,
'#required' => $form[$element_key]['widget']['#required'],
];
}
Expand Down
2 changes: 1 addition & 1 deletion html/modules/custom/ghi_plans/src/Entity/Plan.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public function getPlanCoordinator() {
$value = $this->get('field_plan_coordinator')->getValue();
return !empty($value) ? array_filter(array_map(function ($item) {
return $item['value'];
}, $value)) : NULL;
}, array_filter($value))) : NULL;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion html/sites/default/settings.docksal.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);

$config['system.logging']['error_level'] = ['verbose'];
$config['system.logging']['error_level'] = 'verbose';
$settings['skip_permissions_hardening'] = TRUE;

// Docksal DB connection settings.
Expand Down

0 comments on commit 939fd11

Please sign in to comment.