diff --git a/group.module b/group.module index 31a4088..3105d78 100644 --- a/group.module +++ b/group.module @@ -12,6 +12,7 @@ use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Field\BaseFieldDefinition; use Drupal\Core\Field\FieldDefinitionInterface; use Drupal\Core\Field\FieldItemListInterface; +use Drupal\Core\Field\FieldStorageDefinitionInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Render\Element; use Drupal\Core\Routing\RouteMatchInterface; @@ -215,11 +216,13 @@ function group_entity_base_field_info(EntityTypeInterface $entity_type) { ->setDescription(t('A list of all the groups referencing this entity.')) ->setTranslatable(FALSE) ->setComputed(TRUE) + ->setCardinality(FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED) ->setClass('\Drupal\group\Fields\GroupGroupReferenceItemList') ->setDisplayConfigurable('view', TRUE) ->setDisplayOptions('view', [ - 'label' => 'above', - 'weight' => -5, + 'label' => 'hidden', + 'type' => 'hidden', + 'weight' => 50, ]); foreach (\Drupal::service('entity_type.manager')->getStorage('group_type')->loadMultiple() as $group_type) { @@ -234,11 +237,13 @@ function group_entity_base_field_info(EntityTypeInterface $entity_type) { ->setDescription(t('A list of all the groups referencing this entity.')) ->setTranslatable(FALSE) ->setComputed(TRUE) + ->setCardinality(FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED) ->setClass('\Drupal\group\Fields\GroupGroupReferenceItemList') ->setDisplayConfigurable('view', TRUE) ->setDisplayOptions('view', [ - 'label' => 'above', - 'weight' => -5, + 'label' => 'hidden', + 'type' => 'hidden', + 'weight' => 50, ]); } }