You are here

function radioactivity_form_field_config_edit_form_alter in Radioactivity 4.0.x

Implements hook_form_FORM_ID_alter() for 'field_config_edit_form'.

File

./radioactivity.module, line 144
Provides a field type which can be used as a hotness metric.

Code

function radioactivity_form_field_config_edit_form_alter(array &$form, FormStateInterface $form_state) {
  $fieldConfig = $form_state
    ->getFormObject()
    ->getEntity();
  if ($fieldConfig
    ->getType() !== 'radioactivity_reference') {
    return;
  }
  if (isset($form['required'])) {
    $form['required']['#disabled'] = TRUE;
    $form['required']['#default_value'] = TRUE;
  }
}