Made case provider field use view to filter out inactive and unpubllished

This commit is contained in:
naomi 2021-11-16 08:06:06 +00:00
parent f9d4820ac2
commit 623e801c58

View File

@ -277,9 +277,16 @@ class OCCaseProvision extends EditorialContentEntityBase implements OCCaseProvis
$fields['oc_provider'] = \Drupal\Core\Field\BaseFieldDefinition::create('entity_reference')
->setLabel(t('Provider'))
->setSetting('target_type', 'oc_actor') // TODO: this should eventually point to a Provider rather than an Actor
->setSetting('handler', 'default')
->setSetting('handler', 'views')
->setTranslatable(TRUE)
->setCardinality(1)
->setSetting('handler_settings', [
'view' => [
'view_name' => 'case_providers',
'display_name' => 'entity_reference_1',
'arguments' => [],
]
])
->setDisplayConfigurable("view", true)
->setDisplayConfigurable("form", true)
->setRequired(TRUE);