Commit 342b4921 authored by Gábor Hojtsy's avatar Gábor Hojtsy

Issue #2912298 by chr.fritsch, phenaproxima: Make media name available on manage display

parent 0d11cb1f
......@@ -404,6 +404,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
'weight' => -5,
])
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE)
->setDisplayOptions('view', [
'label' => 'hidden',
'type' => 'string',
......
......@@ -20,4 +20,15 @@ public function testEntity() {
$this->assertSame($media, $media->setOwnerId($this->user->id()), 'setOwnerId() method returns its own entity.');
}
/**
* Ensure media name is configurable on manage display.
*/
public function testNameIsConfigurable() {
/** @var \Drupal\Core\Field\BaseFieldDefinition[] $field_definitions */
$field_definitions = $this->container->get('entity_field.manager')
->getBaseFieldDefinitions('media');
$this->assertTrue($field_definitions['name']->isDisplayConfigurable('view'));
}
}
......@@ -16,8 +16,16 @@ content:
settings: { }
third_party_settings: { }
type: file_default
weight: 1
region: content
name:
label: hidden
type: string
weight: 0
region: content
settings:
link_to_entity: false
third_party_settings: { }
hidden:
created: true
thumbnail: true
......
......@@ -19,8 +19,16 @@ content:
image_link: file
third_party_settings: { }
type: image
weight: 1
region: content
name:
label: hidden
type: string
weight: 0
region: content
settings:
link_to_entity: false
third_party_settings: { }
hidden:
created: true
thumbnail: true
......
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