From 8ee82f214b67a4a007d5ad579c33a8e63aff8794 Mon Sep 17 00:00:00 2001 From: Nathaniel Catchpole <catch@35733.no-reply.drupal.org> Date: Fri, 28 Oct 2016 13:06:15 +0100 Subject: [PATCH] Issue #2788521 by david.gil, SteffenR: hook_options_list_alter sample fails on 8.1.8 --- core/modules/options/options.api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/modules/options/options.api.php b/core/modules/options/options.api.php index a4ac605d4c95..28ac77114ed3 100644 --- a/core/modules/options/options.api.php +++ b/core/modules/options/options.api.php @@ -20,7 +20,7 @@ * properties. * @param array $context * An associative array containing: - * - field_definition: The field definition + * - fieldDefinition: The field definition * (\Drupal\Core\Field\FieldDefinitionInterface). * - entity: The entity object the field is attached to * (\Drupal\Core\Entity\EntityInterface). @@ -30,7 +30,7 @@ */ function hook_options_list_alter(array &$options, array $context) { // Check if this is the field we want to change. - if ($context['field']->id() == 'field_option') { + if ($context['fieldDefinition']->id() == 'field_option') { // Change the label of the empty option. $options['_none'] = t('== Empty =='); } -- GitLab