From c47ce313b36f0c18bb65eb2ef5564588edee2719 Mon Sep 17 00:00:00 2001 From: naomi Date: Tue, 10 Apr 2018 18:09:25 +0200 Subject: [PATCH] Removed all fields from Person in default view mode --- modules/zencrm_entities/src/Entity/Person.php | 53 ++++++------------- 1 file changed, 16 insertions(+), 37 deletions(-) diff --git a/modules/zencrm_entities/src/Entity/Person.php b/modules/zencrm_entities/src/Entity/Person.php index 63c0e96..0ea1f5f 100644 --- a/modules/zencrm_entities/src/Entity/Person.php +++ b/modules/zencrm_entities/src/Entity/Person.php @@ -191,21 +191,21 @@ class Person extends RevisionableContentEntityBase implements PersonInterface { ->setRevisionable(TRUE) ->setSetting('target_type', 'user') ->setSetting('handler', 'default') - ->setDisplayOptions('form', [ - 'type' => 'entity_reference_autocomplete', - 'weight' => 5, - 'settings' => [ - 'match_operator' => 'CONTAINS', - 'size' => '60', - 'autocomplete_type' => 'tags', - 'placeholder' => '', - ], - ]) - ->setDisplayOptions('view', [ - 'label' => 'inline', - 'type' => 'author', - 'weight' => 100, - ]) +# ->setDisplayOptions('form', [ +# 'type' => 'entity_reference_autocomplete', +# 'weight' => 5, +# 'settings' => [ +# 'match_operator' => 'CONTAINS', +# 'size' => '60', +# 'autocomplete_type' => 'tags', +# 'placeholder' => '', +# ], +# ]) +# ->setDisplayOptions('view', [ +# 'label' => 'inline', +# 'type' => 'author', +# 'weight' => 100, +# ]) ->setTranslatable(TRUE); // This field is computed in a presave hook. @@ -228,18 +228,11 @@ class Person extends RevisionableContentEntityBase implements PersonInterface { 'max_length' => 50, 'text_processing' => 0, ]) - ->setDefaultValue('') - ->setDisplayOptions('view', [ - 'label' => 'above', - 'type' => 'string', - 'weight' => -4, - ]) ->setDisplayOptions('form', [ 'type' => 'string_textfield', 'weight' => -4, ]) ->setDisplayConfigurable('form', TRUE) - ->setDisplayConfigurable('view', TRUE) ->setRequired(TRUE); $fields['middle_names'] = BaseFieldDefinition::create('string') @@ -250,18 +243,11 @@ class Person extends RevisionableContentEntityBase implements PersonInterface { 'max_length' => 50, 'text_processing' => 0, ]) - ->setDefaultValue('') - ->setDisplayOptions('view', [ - 'label' => 'above', - 'type' => 'string', - 'weight' => -4, - ]) ->setDisplayOptions('form', [ 'type' => 'string_textfield', 'weight' => -4, ]) - ->setDisplayConfigurable('form', TRUE) - ->setDisplayConfigurable('view', TRUE); + ->setDisplayConfigurable('form', TRUE); $fields['last_name'] = BaseFieldDefinition::create('string') ->setLabel(t('Last Name')) @@ -271,18 +257,11 @@ class Person extends RevisionableContentEntityBase implements PersonInterface { 'max_length' => 50, 'text_processing' => 0, ]) - ->setDefaultValue('') - ->setDisplayOptions('view', [ - 'label' => 'above', - 'type' => 'string', - 'weight' => -4, - ]) ->setDisplayOptions('form', [ 'type' => 'string_textfield', 'weight' => -4, ]) ->setDisplayConfigurable('form', TRUE) - ->setDisplayConfigurable('view', TRUE) ->setRequired(TRUE); $fields['status'] = BaseFieldDefinition::create('boolean')