Made person's address fields form- and view-configurable, and bumped version

This commit is contained in:
Naomi 2021-06-29 09:21:04 +02:00
parent 41505594be
commit 26d78a4f7f
3 changed files with 25 additions and 2 deletions

View File

@ -4,6 +4,20 @@
use \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchemaConverter;
use \Drupal\Core\Field\BaseFieldDefinition;
function opencase_entities_update_80201() {
$update_manager = \Drupal::entityDefinitionUpdateManager();
$definition = $update_manager->getFieldStorageDefinition('phone', 'oc_actor');
$update_manager->updateFieldStorageDefinition($definition);
$definition = $update_manager->getFieldStorageDefinition('phone2', 'oc_actor');
$update_manager->updateFieldStorageDefinition($definition);
$definition = $update_manager->getFieldStorageDefinition('postal_address', 'oc_actor');
$update_manager->updateFieldStorageDefinition($definition);
$definition = $update_manager->getFieldStorageDefinition('email', 'oc_actor');
$update_manager->updateFieldStorageDefinition($definition);
$definition = $update_manager->getFieldStorageDefinition('post_code', 'oc_actor');
$update_manager->updateFieldStorageDefinition($definition);
}
function opencase_entities_update_80200() {
$field_storage_definition = BaseFieldDefinition::create('string')
->setLabel(t('Website'))

View File

@ -315,7 +315,8 @@ class OCActor extends RevisionableContentEntityBase implements OCActorInterface
'max_length' => 30,
'text_processing' => 0,
))
->setDisplayConfigurable('form', true)
->setDisplayConfigurable("form", true)
->setDisplayConfigurable("view", true)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'string',
@ -333,6 +334,8 @@ class OCActor extends RevisionableContentEntityBase implements OCActorInterface
'max_length' => 20,
'text_processing' => 0,
))
->setDisplayConfigurable("form", true)
->setDisplayConfigurable("view", true)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'string',
@ -350,6 +353,8 @@ class OCActor extends RevisionableContentEntityBase implements OCActorInterface
'max_length' => 20,
'text_processing' => 0,
))
->setDisplayConfigurable("form", true)
->setDisplayConfigurable("view", true)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'string',
@ -368,6 +373,8 @@ class OCActor extends RevisionableContentEntityBase implements OCActorInterface
'max_length' => 255,
'text_processing' => 0,
))
->setDisplayConfigurable("form", true)
->setDisplayConfigurable("view", true)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'basic_string',
@ -385,6 +392,8 @@ class OCActor extends RevisionableContentEntityBase implements OCActorInterface
'max_length' => 10,
'text_processing' => 0,
))
->setDisplayConfigurable("form", true)
->setDisplayConfigurable("view", true)
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'string',

View File

@ -2,7 +2,7 @@ name: 'OpenCase'
type: module
description: 'Simple Case Management'
core: 8.x
version: 8.x-2.0.0
version: 8.x-2.0.1
package: 'OpenCase'
dependencies:
- opencase_entities