From 5e0bde90a0560cf0fd2359cb9c2b2df3ede27e6f Mon Sep 17 00:00:00 2001 From: naomi Date: Mon, 20 Jun 2022 13:55:21 +0100 Subject: [PATCH] Deleted old website field --- modules/opencase_entities/opencase_entities.install | 5 +++++ .../opencase_entities/src/Entity/OCOrganisation.php | 12 ------------ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/modules/opencase_entities/opencase_entities.install b/modules/opencase_entities/opencase_entities.install index 9f8b242..c01bb5c 100644 --- a/modules/opencase_entities/opencase_entities.install +++ b/modules/opencase_entities/opencase_entities.install @@ -4,6 +4,11 @@ use \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchemaConverter; use \Drupal\Core\Field\BaseFieldDefinition; +function opencase_entities_update_90004() { + $update_manager = \Drupal::entityDefinitionUpdateManager(); + $definition = $update_manager->getFieldStorageDefinition('website', 'oc_organisation'); + $update_manager->uninstallFieldStorageDefinition($definition); +} function opencase_entities_update_90003() { $field_storage_definition = BaseFieldDefinition::create('link') diff --git a/modules/opencase_entities/src/Entity/OCOrganisation.php b/modules/opencase_entities/src/Entity/OCOrganisation.php index 67c0aae..821bc5b 100644 --- a/modules/opencase_entities/src/Entity/OCOrganisation.php +++ b/modules/opencase_entities/src/Entity/OCOrganisation.php @@ -211,23 +211,11 @@ class OCOrganisation extends EditorialContentEntityBase implements OCOrganisatio 'max_length' => 255, 'text_processing' => 0, )); - $fields['website'] = BaseFieldDefinition::create('string') - ->setLabel(t('Website')) - ->setRevisionable(TRUE) - ->setSettings([ - 'max_length' => 50, - 'text_processing' => 0, - ]) - ->setDefaultValue('') - ->setDisplayConfigurable('form', true) - ->setDisplayConfigurable('view', true) - ->setRequired(FALSE); $fields['org_website'] = BaseFieldDefinition::create('link') ->setLabel(t('Website')) ->setRevisionable(TRUE) ->setSettings([ - 'max_length' => 50, 'text_processing' => 0, 'title' => 0, 'link_type' => 16