Deprecated - 8.9.x - drupal

Primary tabs

Title File name Deprecation Type Direct uses Namespaced uses Overrides Use statements
ContentLanguageSettingsResourceTestBase core/modules/rest/tests/src/Functional/EntityResource/ContentLanguageSettings/ContentLanguageSettingsResourceTestBase.php

in drupal:8.6.0 and is removed from drupal:9.0.0. Use Drupal\Tests\language\Functional\Rest\ContentLanguageSettingsResourceTestBase instead.

class
ContentModerationState::getCurrentUserId core/modules/content_moderation/src/Entity/ContentModerationState.php

The ::getCurrentUserId method is deprecated in 8.6.x and will be removed before 9.0.0.

function 1
ContentTranslationTestBase core/modules/content_translation/src/Tests/ContentTranslationTestBase.php

in drupal:8.?.? and is removed from drupal:9.0.0. Use \Drupal\Tests\content_translation\Functional\ContentTranslationTestBase instead.

class 1
ContentTranslationUITestBase core/modules/content_translation/src/Tests/ContentTranslationUITestBase.php

in drupal:8.?.? and is removed from drupal:9.0.0. Use \Drupal\Tests\content_translation\Functional\ContentTranslationUITestBase instead.

class
ContentTranslationUpdatesManager core/modules/content_translation/src/ContentTranslationUpdatesManager.php

in drupal:8.7.0 and is removed from drupal:9.0.0. Definitions are updated automatically now so no replacement is needed.

class
ContentTypeCreationTrait core/modules/simpletest/src/ContentTypeCreationTrait.php

in drupal:8.4.0 and is removed from drupal:9.0.0. Use \Drupal\Tests\node\Traits\ContentTypeCreationTrait instead.

trait
ContextAwarePluginBase::$contexts core/lib/Drupal/Component/Plugin/ContextAwarePluginBase.php

in drupal:8.8.0 and is removed from drupal:9.0.0. Use \Drupal\Component\Plugin\ContextAwarePluginInterface instead.

property
ContextDefinition::$entityContextDefinition core/lib/Drupal/Core/Plugin/Context/ContextDefinition.php

Constructing a context definition for an entity type (i.e., the data type begins with 'entity:') is deprecated in Drupal 8.6.0. Instead, use the static factory methods of EntityContextDefinition to create context definitions for entity types, or the static ::create() method of this class for any other data type. See https://www.drupal.org/node/2976400 for more information.

property
ControllerBase::entityManager core/lib/Drupal/Core/Controller/ControllerBase.php

in drupal:8.0.0 and is removed from drupal:9.0.0. Most of the time static::entityTypeManager() is supposed to be used instead.

function
Crypt::hashEquals core/lib/Drupal/Component/Utility/Crypt.php

in drupal:8.8.0 and is removed from drupal:9.0.0. Use PHP's built-in hash_equals() function instead.

function 1
Crypt::randomBytes core/lib/Drupal/Component/Utility/Crypt.php

in drupal:8.8.0 and is removed from drupal:9.0.0. Use PHP's built-in random_bytes() function instead.

function 1
D6VariableTranslation core/modules/migrate_drupal/src/Plugin/migrate/source/d6/D6VariableTranslation.php

in drupal:8.7.0 and is removed from drupal:9.0.0. Use \Drupal\migrate_drupal\Plugin\migrate\source\d6\VariableTranslation.

class
DatabaseWebTestBase core/modules/system/src/Tests/Database/DatabaseWebTestBase.php

in drupal:8.4.0 and is removed from drupal:9.0.0. Instead use \Drupal\Tests\system\Functional\Database\DatabaseTestBase.

class
DateField core/modules/datetime/src/Plugin/migrate/field/d6/DateField.php

in drupal:8.4.0 and is removed from drupal:9.0.0. Use \Drupal\datetime\Plugin\migrate\field\DateField instead.

class 1
DateFormatResourceTestBase core/modules/rest/tests/src/Functional/EntityResource/DateFormat/DateFormatResourceTestBase.php

in drupal:8.6.0 and is removed from drupal:9.0.0. Use Drupal\FunctionalTests\Rest\DateFormatResourceTestBase instead.

class
DateTestBase core/modules/datetime/src/Tests/DateTestBase.php

in drupal:8.4.0 and is removed from drupal:9.0.0. Use \Drupal\Tests\BrowserTestBase instead.

class
DateTimeHandlerTestBase core/modules/datetime/src/Tests/Views/DateTimeHandlerTestBase.php

in drupal:8.4.0 and is removed from drupal:9.0.0. Use \Drupal\Tests\BrowserTestBase.

class
DATETIME_DATETIME_STORAGE_FORMAT core/modules/datetime/datetime.module

in drupal:8.5.0 and is removed from drupal:9.0.0. Use \Drupal\datetime\Plugin\Field\FieldType\DateTimeItemInterface::DATETIME_STORAGE_FORMAT instead.

constant
datetime_date_default_time core/modules/datetime/datetime.module

in drupal:8.5.0 and is removed from drupal:9.0.0. Use \Drupal\Component\Datetime\DateTimePlus::setDefaultDateTime() or \Drupal\Core\Datetime\DrupalDateTime::setDefaultDateTime() instead.

function
DATETIME_DATE_STORAGE_FORMAT core/modules/datetime/datetime.module

in drupal:8.5.0 and is removed from drupal:9.0.0. Use \Drupal\datetime\Plugin\Field\FieldType\DateTimeItemInterface::DATE_STORAGE_FORMAT instead.

constant
datetime_range_view_presave core/modules/datetime_range/datetime_range.module

in drupal:8.5.0 and is removed from drupal:9.0.0.

function
DATETIME_STORAGE_TIMEZONE core/modules/datetime/datetime.module

in drupal:8.5.0 and is removed from drupal:9.0.0. Use \Drupal\datetime\Plugin\Field\FieldType\DateTimeItemInterface::STORAGE_TIMEZONE instead.

constant
date_iso8601 core/includes/common.inc

in drupal:8.7.0 and is removed from drupal:9.0.0. Use date('c', $date) instead.

function
dblog_view_presave core/modules/dblog/dblog.module

in drupal:8.4.0 and is removed from drupal:9.0.0.

function
DbUpdatesTrait core/modules/system/src/Tests/Update/DbUpdatesTrait.php

in drupal:8.4.0 and is removed from drupal:9.0.0. Use \Drupal\FunctionalTests\Update\DbUpdatesTrait.

trait
db_add_field core/includes/database.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call addField() on it. For example, $injected_database->schema()->addField($table, $field, $spec, $keys_new);

function 1
db_add_index core/includes/database.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call addIndex() on it. For example, $injected_database->schema()->addIndex($table, $name, $fields, $spec);

function 1
db_add_primary_key core/includes/database.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call addPrimaryKey() on it. For example, $injected_database->schema()->addPrimaryKey($table, $fields);

function 1
db_add_unique_key core/includes/database.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call addUniqueKey() on it. For example, $injected_database->schema()->addUniqueKey($table, $name, $fields);

function 1
db_and core/includes/database.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Create a \Drupal\Core\Database\Query\Condition object, specifying an AND conjunction: new Condition('AND');

function 1
db_change_field core/includes/database.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call changeField() on it. For example, $injected_database->schema() ->changeField($table, $field, $field_new, $spec, $keys_new);

function 1
db_close core/includes/database.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Database\Database::closeConnection($target).

function 1
db_condition core/includes/database.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Create a \Drupal\Core\Database\Query\Condition object, specifying the desired conjunction: new Condition($conjunction);

function 1
db_create_table core/includes/database.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call createTable() on it. For example, $injected_database->schema()->createTable($name, $table);

function 1
db_delete core/includes/database.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container and call delete() on it. For example, $injected_database->delete($table, $options);

function 1
db_driver core/includes/database.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container and call driver() on it. For example, $injected_database->driver($string);

function 1
db_drop_field core/includes/database.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call dropField() on it. For example, $injected_database->schema()->dropField($table, $field);

function 1
db_drop_index core/includes/database.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call dropIndex() on it. For example, $injected_database->schema()->dropIndex($table, $name);

function 1
db_drop_primary_key core/includes/database.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call dropPrimaryKey() on it. For example, $injected_database->schema()->dropPrimaryKey($table);

function 1
db_drop_table core/includes/database.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call dropTable() on it. For example, $injected_database->schema()->dropTable($table);

function 1
db_drop_unique_key core/includes/database.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call dropUniqueKey() on it. For example, $injected_database->schema()->dropUniqueKey($table, $name);

function 1
db_escape_field core/includes/database.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container and call escapeField() on it. For example, $injected_database->escapeField($field);

function 1
db_escape_table core/includes/database.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container and call escapeTable() on it. For example, $injected_database->escapeTable($table);

function 1
db_field_exists core/includes/database.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call fieldExists() on it. For example, $injected_database->schema()->fieldExists($table, $field);

function 1
db_field_names core/includes/database.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call fieldNames() on it. For example, $injected_database->schema()->fieldNames($fields);

function 1
db_field_set_default core/includes/database.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call changeField() on it, passing a full field specification. For example, $injected_database->schema() ->changeField($table, $field, $field_new, $spec, $keys_new);

function 1
db_field_set_no_default core/includes/database.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call changeField() on it, passing a full field specification. For example, $injected_database->schema() ->changeField($table, $field, $field_new, $spec, $keys_new);

function 1
db_find_tables core/includes/database.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call findTables() on it. For example, $injected_database->schema()->findTables($table_expression);

function 1
db_ignore_replica core/includes/database.inc

in drupal:8.7.0 and is removed from drupal:9.0.0. Use \Drupal::service('database.replica_kill_switch')->trigger() instead.

function 1
db_index_exists core/includes/database.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call indexExists() on it. For example, $injected_database->schema()->indexExists($table, $name);

function 1

Other projects


Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.