diff --git a/helfi_tpr.install b/helfi_tpr.install index 26c68de..96318ab 100644 --- a/helfi_tpr.install +++ b/helfi_tpr.install @@ -300,22 +300,3 @@ function helfi_tpr_update_8045() : void { \Drupal::entityDefinitionUpdateManager() ->installFieldStorageDefinition('topical', 'tpr_unit', 'helfi_tpr', $topical_field); } - -/** - * UHF-9159 Add SUBGROUP field to Unit entity. - */ -function helfi_tpr_update_8046() : void { - $subgroup_field = BaseFieldDefinition::create('tpr_connection') - ->setLabel(new TranslatableMarkup('Subgroup', [], ['context' => 'TPR Unit field label'])) - ->setDescription(new TranslatableMarkup('The "SUBGROUP" connection type')) - ->setTranslatable(TRUE) - ->setCardinality(BaseFieldDefinition::CARDINALITY_UNLIMITED) - ->setDisplayOptions('form', [ - 'type' => 'readonly_field_widget', - ]) - ->setDisplayConfigurable('form', TRUE) - ->setDisplayConfigurable('view', TRUE); - - \Drupal::entityDefinitionUpdateManager() - ->installFieldStorageDefinition('subgroup', 'tpr_unit', 'helfi_tpr', $subgroup_field); -} diff --git a/migrations/tpr_unit.yml b/migrations/tpr_unit.yml index 79a7fc0..89ea5e1 100644 --- a/migrations/tpr_unit.yml +++ b/migrations/tpr_unit.yml @@ -104,18 +104,6 @@ process: value: value data: data type: type - _subgroup_connections: - plugin: array_element_equals - source: connections - value: SUBGROUP - key: type - subgroup: - plugin: sub_process - source: '@_subgroup_connections' - process: - value: value - data: data - type: type _contacts_connections: plugin: array_element_equals source: connections diff --git a/src/Entity/Unit.php b/src/Entity/Unit.php index d7f5255..4489230 100644 --- a/src/Entity/Unit.php +++ b/src/Entity/Unit.php @@ -356,10 +356,6 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) : 'description' => 'TOPICAL', 'label' => new TranslatableMarkup('Topical', [], ['context' => 'TPR Unit field label']), ], - 'subgroup' => [ - 'description' => 'SUBGROUP', - 'label' => new TranslatableMarkup('Subgroup', [], ['context' => 'TPR Unit field label']), - ], ]; foreach ($connectionFields as $name => $data) { diff --git a/src/Field/Connection/Repository.php b/src/Field/Connection/Repository.php index 2ad81f4..dd238eb 100644 --- a/src/Field/Connection/Repository.php +++ b/src/Field/Connection/Repository.php @@ -23,7 +23,6 @@ final class Repository { Link::TYPE_NAME => Link::class, PhoneOrEmail::TYPE_NAME => PhoneOrEmail::class, Topical::TYPE_NAME => Topical::class, - Subgroup::TYPE_NAME => Subgroup::class, ]; /** diff --git a/src/Field/Connection/Subgroup.php b/src/Field/Connection/Subgroup.php deleted file mode 100644 index fed229e..0000000 --- a/src/Field/Connection/Subgroup.php +++ /dev/null @@ -1,67 +0,0 @@ -getFields(); - $fields_data = []; - $name = ''; - - foreach ($fields as $field) { - if (!$this->get($field)) { - continue; - } - - $data = Html::escape($this->get($field)); - - if ($field === 'name') { - $fields_data[] = '' . $data . ''; - } - else { - $fields_data[] = $data; - } - } - - $markup = '

' . implode('
', $fields_data) . '

'; - - $build = [ - 'contact' => [ - '#markup' => $markup, - ], - ]; - - return $build; - } - -}