Commit cbef10d7 authored by alexpott's avatar alexpott

Issue #2536374 by DuaelFr: Generate placeholder content for ListItemBase Field types

parent 573fab03
......@@ -71,7 +71,9 @@ public function getSettableOptions(AccountInterface $account = NULL) {
* {@inheritdoc}
*/
public static function generateSampleValue(FieldDefinitionInterface $field_definition) {
// @todo Implement this once https://www.drupal.org/node/2238085 lands.
$allowed_options = options_allowed_values($field_definition->getFieldStorageDefinition());
$values['value'] = array_rand($allowed_options);
return $values;
}
/**
......
......@@ -80,6 +80,7 @@ function testUpdateAllowedValues() {
'field_name' => $this->fieldName,
'entity_type' => 'entity_test',
'bundle' => 'entity_test',
'required' => TRUE,
))->save();
entity_get_form_display('entity_test', 'entity_test', 'default')
->setComponent($this->fieldName, array(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment