From 517938ab7b0d68525c3713a7d1a06b145b1e008f Mon Sep 17 00:00:00 2001 From: naomi Date: Thu, 28 Jan 2021 11:54:07 +0000 Subject: [PATCH] Added description field to event --- .../opencase_entities/src/Entity/OCEvent.php | 20 +++++++++++++++++++ opencase.module | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/modules/opencase_entities/src/Entity/OCEvent.php b/modules/opencase_entities/src/Entity/OCEvent.php index edce002..31360d5 100644 --- a/modules/opencase_entities/src/Entity/OCEvent.php +++ b/modules/opencase_entities/src/Entity/OCEvent.php @@ -153,6 +153,26 @@ class OCEvent extends ContentEntityBase implements OCEventInterface { 'weight' => -3, ]); + $fields['description'] = BaseFieldDefinition::create('string_long') + ->setLabel(t('Description')) + ->setRevisionable(TRUE) + ->setSettings([ + 'max_length' => 50, + 'text_processing' => 0, + ]) + ->setDefaultValue('') + ->setDisplayOptions('view', [ + 'label' => 'above', + 'type' => 'basic_string', + 'weight' => -1, + ]) + ->setDisplayOptions('form', [ + 'type' => 'string_textarea', + 'weight' => -1, + ]) + ->setRequired(FALSE); + + return $fields; } diff --git a/opencase.module b/opencase.module index aafa24f..7ae451b 100644 --- a/opencase.module +++ b/opencase.module @@ -88,7 +88,7 @@ function opencase_uninstall() { $configs = [ 'block.block.opencase', 'system.menu.opencase', - 'views.view.contact_details_changes' + 'views.view.contact_details_changes', ]; foreach($configs as $config) { Drupal::configFactory()->getEditable($config)->delete();