Loading allowed_options.info.yml +1 −1 Original line number Diff line number Diff line name: Allowed Options type: module description: 'Limits available options on field instance widget level.' core_version_requirement: ^8 || ^9 || ^10 core_version_requirement: ^9.2 || ^10 allowed_options.module +2 −2 Original line number Diff line number Diff line Loading @@ -43,12 +43,12 @@ function allowed_options_entity_form_display_presave(EntityInterface $entity) { } /** * Implements hook_field_widget_form_alter(). * Implements hook_field_widget_single_element_form_alter(). * * TODO: Switch to hook_options_list_alter() when (if) * https://www.drupal.org/project/drupal/issues/3134618 is landed. */ function allowed_options_field_widget_form_alter(&$element, FormStateInterface $form_state, $context) { function allowed_options_field_widget_single_element_form_alter(array &$element, FormStateInterface $form_state, array $context) { /** @var \Drupal\Core\Field\FieldDefinitionInterface $field_definition */ $field_definition = $context['items']->getFieldDefinition(); if (!$field_definition instanceof FieldConfig) { Loading Loading
allowed_options.info.yml +1 −1 Original line number Diff line number Diff line name: Allowed Options type: module description: 'Limits available options on field instance widget level.' core_version_requirement: ^8 || ^9 || ^10 core_version_requirement: ^9.2 || ^10
allowed_options.module +2 −2 Original line number Diff line number Diff line Loading @@ -43,12 +43,12 @@ function allowed_options_entity_form_display_presave(EntityInterface $entity) { } /** * Implements hook_field_widget_form_alter(). * Implements hook_field_widget_single_element_form_alter(). * * TODO: Switch to hook_options_list_alter() when (if) * https://www.drupal.org/project/drupal/issues/3134618 is landed. */ function allowed_options_field_widget_form_alter(&$element, FormStateInterface $form_state, $context) { function allowed_options_field_widget_single_element_form_alter(array &$element, FormStateInterface $form_state, array $context) { /** @var \Drupal\Core\Field\FieldDefinitionInterface $field_definition */ $field_definition = $context['items']->getFieldDefinition(); if (!$field_definition instanceof FieldConfig) { Loading