diff --git a/core/lib/Drupal/Core/Field/BaseFieldDefinition.php b/core/lib/Drupal/Core/Field/BaseFieldDefinition.php index 2ff671613ee05f54dc6c4f6082026abbe618aeff..e703b3852855f0944c8c4b8c630f3cddcf8a0ea9 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,7 +286,8 @@ public function isMultiple() { * {@inheritdoc} */ public function isQueryable() { - return isset($this->definition['queryable']) ? $this->definition['queryable'] : !$this->isComputed(); + @trigger_error('BaseFieldDefinition::isQueryable() is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, you should use \Drupal\Core\Field\BaseFieldDefinition::hasCustomStorage(). See https://www.drupal.org/node/2856563.', E_USER_DEPRECATED); + return !$this->hasCustomStorage(); } /** @@ -298,8 +298,14 @@ public function isQueryable() { * * @return static * The object itself for chaining. + * + * @deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Use + * \Drupal\Core\Field\BaseFieldDefinition::setCustomStorage() instead. + * + * @see https://www.drupal.org/node/2856563 */ public function setQueryable($queryable) { + @trigger_error('BaseFieldDefinition::setQueryable() is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, you should use \Drupal\Core\Field\BaseFieldDefinition::setCustomStorage(). See https://www.drupal.org/node/2856563.', E_USER_DEPRECATED); $this->definition['queryable'] = $queryable; return $this; } diff --git a/core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php b/core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php index 1b842b9ef56fd9f7e5bf6e249220f50d643e7140..d703659bdbf257aac88bbd647c1be6d087484367 100644 --- a/core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php +++ b/core/lib/Drupal/Core/Field/FieldStorageDefinitionInterface.php @@ -109,6 +109,12 @@ public function isRevisionable(); * * @return bool * TRUE if the field is queryable. + * + * @deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Use + * \Drupal\Core\Field\FieldStorageDefinitionInterface::hasCustomStorage() + * instead. + * + * @see https://www.drupal.org/node/2856563 */ public function isQueryable(); diff --git a/core/modules/node/src/Entity/Node.php b/core/modules/node/src/Entity/Node.php index 13192cf9daa7b59d10ccb5b3893eb124fa64617b..263f7c8f7334a4ed17a9a9ccd2d4124d772c497a 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')