Issue #2788521 by david.gil, SteffenR: hook_options_list_alter sample fails on 8.1.8

8.3.x
Nathaniel Catchpole 2016-10-28 13:06:15 +01:00
parent 8d783b7c79
commit 8ee82f214b
1 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ use Drupal\Core\Field\FieldStorageDefinitionInterface;
* 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 @@ 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['field']->id() == 'field_option') {
if ($context['fieldDefinition']->id() == 'field_option') {
// Change the label of the empty option.
$options['_none'] = t('== Empty ==');
}