diff --git a/core/modules/field/lib/Drupal/field/Plugin/Type/FieldType/ConfigEntityReferenceItemBase.php b/core/modules/field/lib/Drupal/field/Plugin/Type/FieldType/ConfigEntityReferenceItemBase.php index 92002ce..ffde0a9 100644 --- a/core/modules/field/lib/Drupal/field/Plugin/Type/FieldType/ConfigEntityReferenceItemBase.php +++ b/core/modules/field/lib/Drupal/field/Plugin/Type/FieldType/ConfigEntityReferenceItemBase.php @@ -156,7 +156,7 @@ public function instanceSettingsForm(array $form, array &$form_state) { */ public function getSettableOptions() { $definition = $this->getPluginDefinition(); - $callback = "{$definition['module']}_options_list"; + $callback = "{$definition['provider']}_options_list"; if (function_exists($callback)) { // We are at the field item level, so we need to go two levels up to get // to the entity object. diff --git a/core/modules/options/lib/Drupal/options/Tests/OptionsFieldTest.php b/core/modules/options/lib/Drupal/options/Tests/OptionsFieldTest.php index 218e413..2a8c1a6 100644 --- a/core/modules/options/lib/Drupal/options/Tests/OptionsFieldTest.php +++ b/core/modules/options/lib/Drupal/options/Tests/OptionsFieldTest.php @@ -70,8 +70,11 @@ function testUpdateAllowedValues() { $this->assertTrue(empty($form[$this->fieldName][$langcode][3]), 'Option 3 does not exist'); // Completely new options appear. - $this->field['settings']['allowed_values'] = array(10 => 'Update', 20 => 'Twenty'); + $this->field->settings['allowed_values'] = array(10 => 'Update', 20 => 'Twenty'); $this->field->save(); + // The entity holds an outdated field object with the old allowed values + // setting, so we need to reintialize the entity object. + $entity = entity_create('entity_test', array()); $form = \Drupal::entityManager()->getForm($entity); $this->assertTrue(empty($form[$this->fieldName][$langcode][1]), 'Option 1 does not exist'); $this->assertTrue(empty($form[$this->fieldName][$langcode][2]), 'Option 2 does not exist');