Commit 102c6744 authored by Evgeny Leonov's avatar Evgeny Leonov
Browse files

Issue #3256203: Use EntityOwnerTrait method instead the custom one for setting default value

parent f0178cad
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
## [Unreleased]

### Changed
- [#3256203]: Use EntityOwnerTrait method instead the custom one for setting default value
- [#3079282] by lakeloafer: PubMed abst_e field - contains basic html

### Fixed
@@ -786,3 +787,4 @@ Add description to reference types, prefill it with sensible defaults. On refere
[//]: # "Issues links dev"
[#3212586]: https://www.drupal.org/node/3212586
[#3079282]: https://www.drupal.org/node/3079282
[#3256203]: https://www.drupal.org/node/3256203
+3 −2
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ use Drupal\Core\Entity\EditorialContentEntityBase;
use Drupal\Core\Entity\EntityChangedTrait;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\user\EntityOwnerTrait;
use Drupal\user\UserInterface;

/**
@@ -87,7 +88,7 @@ class Reference extends EditorialContentEntityBase implements ReferenceInterface

  use EntityChangedTrait;
  use EntityPublishedTrait;
  // @todo Also use \Drupal\user\EntityOwnerTrait ?
  use EntityOwnerTrait;

  /**
   * Whether the reference is being previewed or not.
@@ -192,7 +193,7 @@ class Reference extends EditorialContentEntityBase implements ReferenceInterface
      ->setDescription(t('The username of the content author.'))
      ->setRevisionable(TRUE)
      ->setSetting('target_type', 'user')
      ->setDefaultValueCallback('Drupal\bibcite_entity\Entity\Reference::getCurrentUserId')
      ->setDefaultValueCallback('Drupal\bibcite_entity\Entity\Reference::getDefaultEntityOwner')
      ->setDisplayOptions('form', [
        'type' => 'entity_reference_autocomplete',
        'weight' => 100,