diff --git a/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php b/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php index 4a6d877..0a7ce5b 100644 --- a/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php +++ b/core/lib/Drupal/Core/Field/TypedData/FieldItemDataDefinition.php @@ -63,6 +63,28 @@ public function getPropertyDefinition($name) { * {@inheritdoc} */ public function getPropertyDefinitions() { + /** + * BEGIN SMORTYWARE. + * + * @see + * - https://www.drupal.org/node/2788277 + * - https://www.drupal.org/node/2716075 + * - https://www.drupal.org/node/2443165 + * - https://www.drupal.org/node/2750463 + */ + if (!is_object($this->fieldDefinition)) { + if ($this->definition['settings']['target_type'] == 'node_type') { + $this->fieldDefinition = BaseFieldDefinition::create('entity_reference'); + $this->fieldDefinition->setSettings($this->definition['settings']); + } + else if ($this->definition['class'] == '\Drupal\user\UserNameItem') { + $this->fieldDefinition = BaseFieldDefinition::create('string'); + $this->fieldDefinition->setSettings($this->definition['settings']); + } + } + /** + * END SMORTYWARE. + */ return $this->fieldDefinition->getFieldStorageDefinition()->getPropertyDefinitions(); }