Added owners field to assets as well as logs

This commit is contained in:
Jotham Gates 2022-02-23 23:51:53 +11:00
parent bd6499ecb5
commit 76cce7d908
2 changed files with 3 additions and 2 deletions

View File

@ -7,3 +7,4 @@ dependencies:
- drupal:user
- farm:farm_field
- log:log
- asset:asset

View File

@ -13,8 +13,8 @@ use Drupal\Core\Entity\EntityTypeInterface;
function farm_owner_entity_base_field_info(EntityTypeInterface $entity_type) {
$fields = [];
// Add owner field to logs.
if ($entity_type->id() == 'log') {
// Add owner field to logs and assets.
if ($entity_type->id() == 'log' || $entity_type->id() == 'asset') {
$field_info = [
'type' => 'entity_reference',
'label' => t('Assigned to'),