diff --git a/html/modules/custom/reliefweb_entities/src/Services/JobFormAlter.php b/html/modules/custom/reliefweb_entities/src/Services/JobFormAlter.php index 05fb1b849..7f20810be 100644 --- a/html/modules/custom/reliefweb_entities/src/Services/JobFormAlter.php +++ b/html/modules/custom/reliefweb_entities/src/Services/JobFormAlter.php @@ -54,7 +54,9 @@ protected function addBundleFormAlterations(array &$form, FormStateInterface $fo $this->addSelectionLimit($form, 'field_career_categories', 1); // Prevent Drupal from returning "An illegal choice was selected" error // message instead of indicating the field is mandatory. - $form['field_career_categories']['widget']['#default_value'] = NULL; + if (empty($form['field_career_categories']['widget']['#default_value'])) { + $form['field_career_categories']['widget']['#default_value'] = NULL; + } // Disable themes for some career categories and limit selection. $this->alterJobThemeField($form, $form_state);