Skip to content
Snippets Groups Projects
Commit 8ee82f21 authored by catch's avatar catch
Browse files

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

parent 8d783b7c
No related branches found
No related tags found
No related merge requests found
......@@ -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 ==');
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment