diff --git a/core/modules/options/options.api.php b/core/modules/options/options.api.php index 0f52b2befa9e12a..fbcc8093180c514 100644 --- a/core/modules/options/options.api.php +++ b/core/modules/options/options.api.php @@ -30,7 +30,7 @@ use Drupal\Core\Field\FieldStorageDefinitionInterface; */ function hook_options_list_alter(array &$options, array $context) { // Check if this is the field we want to change. - if ($context['fieldDefinition']->id() == 'field_option') { + if ($context['fieldDefinition']->getName() == 'field_option') { // Change the label of the empty option. $options['_none'] = t('== Empty =='); }