diff --git a/core/lib/Drupal/Core/Field/BaseFieldDefinition.php b/core/lib/Drupal/Core/Field/BaseFieldDefinition.php index 2ff6716..63c1810 100644 --- a/core/lib/Drupal/Core/Field/BaseFieldDefinition.php +++ b/core/lib/Drupal/Core/Field/BaseFieldDefinition.php @@ -89,7 +89,6 @@ public static function createFromFieldStorageDefinition(FieldStorageDefinitionIn ->setLabel($definition->getLabel()) ->setName($definition->getName()) ->setProvider($definition->getProvider()) - ->setQueryable($definition->isQueryable()) ->setRevisionable($definition->isRevisionable()) ->setSettings($definition->getSettings()) ->setTargetEntityTypeId($definition->getTargetEntityTypeId()) @@ -287,21 +286,7 @@ public function isMultiple() { * {@inheritdoc} */ public function isQueryable() { - return isset($this->definition['queryable']) ? $this->definition['queryable'] : !$this->isComputed(); - } - - /** - * Sets whether the field is queryable. - * - * @param bool $queryable - * Whether the field is queryable. - * - * @return static - * The object itself for chaining. - */ - public function setQueryable($queryable) { - $this->definition['queryable'] = $queryable; - return $this; + return !$this->hasCustomStorage(); } /** diff --git a/core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php b/core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php index 1b842b9..53b36c6 100644 --- a/core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php +++ b/core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php @@ -109,6 +109,10 @@ public function isRevisionable(); * * @return bool * TRUE if the field is queryable. + * + * @deprecated in Drupal 8.4.x, will be removed before Drupal 9.0.x. Use + * \Drupal\Core\Field\FieldStorageDefinitionInterface::hasCustomStorage() + * instead. */ public function isQueryable(); diff --git a/core/modules/node/src/Entity/Node.php b/core/modules/node/src/Entity/Node.php index 13192cf..263f7c8 100644 --- a/core/modules/node/src/Entity/Node.php +++ b/core/modules/node/src/Entity/Node.php @@ -458,14 +458,12 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { $fields['revision_timestamp'] = BaseFieldDefinition::create('created') ->setLabel(t('Revision timestamp')) ->setDescription(t('The time that the current revision was created.')) - ->setQueryable(FALSE) ->setRevisionable(TRUE); $fields['revision_uid'] = BaseFieldDefinition::create('entity_reference') ->setLabel(t('Revision user ID')) ->setDescription(t('The user ID of the author of the current revision.')) ->setSetting('target_type', 'user') - ->setQueryable(FALSE) ->setRevisionable(TRUE); $fields['revision_log'] = BaseFieldDefinition::create('string_long')