From 17239e56db0a4783388321b3cc406e17a8fe6f6b Mon Sep 17 00:00:00 2001 From: Owen Bush <ojb@ukhhf.co.uk> Date: Fri, 1 Mar 2019 19:19:28 -0700 Subject: [PATCH] Adding a body field. --- src/Entity/EventSeries.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/Entity/EventSeries.php b/src/Entity/EventSeries.php index d64d46c6..a10970d6 100644 --- a/src/Entity/EventSeries.php +++ b/src/Entity/EventSeries.php @@ -298,11 +298,6 @@ class EventSeries extends EditorialContentEntityBase implements EventSeriesInter ->setSetting('target_type', 'user') ->setDefaultValueCallback('Drupal\recurring_events\Entity\Event::getCurrentUserId') ->setTranslatable(TRUE) - ->setDisplayOptions('view', [ - 'label' => 'hidden', - 'type' => 'author', - 'weight' => 0, - ]) ->setDisplayOptions('form', [ 'type' => 'entity_reference_autocomplete', 'weight' => 5, @@ -329,11 +324,6 @@ class EventSeries extends EditorialContentEntityBase implements EventSeriesInter 'max_length' => 255, 'text_processing' => 0, ]) - ->setDisplayOptions('view', [ - 'label' => 'above', - 'type' => 'string', - 'weight' => -6, - ]) ->setDisplayOptions('form', [ 'type' => 'string_textfield', 'weight' => -6, @@ -344,6 +334,18 @@ class EventSeries extends EditorialContentEntityBase implements EventSeriesInter ->setTranslatable(TRUE) ->setRequired(TRUE); + $fields['body'] = BaseFieldDefinition::create('text_with_summary') + ->setLabel(t('Description of the event.')) + ->setTranslatable(TRUE) + ->setRevisionable(TRUE) + ->setRequired(TRUE) + ->setDisplayConfigurable('view', TRUE) + ->setDisplayOptions('form', [ + 'type' => 'text_textarea_with_summary', + 'weight' => -5, + ]) + ->setDisplayConfigurable('form', TRUE); + $fields['recur_type'] = BaseFieldDefinition::create('list_string') ->setLabel(t('Recur Type')) ->setDescription('The way that the event recurs.') @@ -399,7 +401,7 @@ class EventSeries extends EditorialContentEntityBase implements EventSeriesInter ]); $fields['custom_date'] = BaseFieldDefinition::create('daterange') - ->setLabel(t('Custom Date')) + ->setLabel(t('Custom Date(s) and Time(s)')) ->setDescription('The custom date configuration.') ->setDisplayConfigurable('form', TRUE) ->setDisplayConfigurable('view', TRUE) -- GitLab