Commit 45ca9fb3 authored by Ivan Doroshenko's avatar Ivan Doroshenko
Browse files

Issue #3286045 by Project Update Bot, Matroskeen: Drupal 10 compatibility fixes.

parent 67dbff26
Loading
Loading
Loading
Loading
+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
+2 −2
Original line number Diff line number Diff line
@@ -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) {