You are here

Deprecated in Drupal 8

Primary tabs

Examples: "before Drupal 9", "in Drupal 8.4"
Namesort descending Location Type Deprecation Direct uses Namespaced uses Overrides Use statements
ContentLanguageSettingsResourceTestBase core/modules/rest/tests/src/Functional/EntityResource/ContentLanguageSettings/ContentLanguageSettingsResourceTestBase.php class in drupal:8.6.0 and is removed from drupal:9.0.0. Use Drupal\Tests\language\Functional\Rest\ContentLanguageSettingsResourceTestBase instead.
ContentModerationState::getCurrentUserId core/modules/content_moderation/src/Entity/ContentModerationState.php function The ::getCurrentUserId method is deprecated in 8.6.x and will be removed before 9.0.0. 1
ContentTranslationTestBase core/modules/content_translation/src/Tests/ContentTranslationTestBase.php class in drupal:8.?.? and is removed from drupal:9.0.0. Use \Drupal\Tests\content_translation\Functional\ContentTranslationTestBase instead. 1
ContentTranslationUITestBase core/modules/content_translation/src/Tests/ContentTranslationUITestBase.php class in drupal:8.?.? and is removed from drupal:9.0.0. Use \Drupal\Tests\content_translation\Functional\ContentTranslationUITestBase instead.
ContentTranslationUpdatesManager core/modules/content_translation/src/ContentTranslationUpdatesManager.php class in drupal:8.7.0 and is removed from drupal:9.0.0. Definitions are updated automatically now so no replacement is needed.
ContentTypeCreationTrait core/modules/simpletest/src/ContentTypeCreationTrait.php trait in drupal:8.4.0 and is removed from drupal:9.0.0. Use \Drupal\Tests\node\Traits\ContentTypeCreationTrait instead.
ContextAwarePluginBase::$contexts core/lib/Drupal/Component/Plugin/ContextAwarePluginBase.php property in drupal:8.8.0 and is removed from drupal:9.0.0. Use \Drupal\Component\Plugin\ContextAwarePluginInterface instead.
ContextDefinition::$entityContextDefinition core/lib/Drupal/Core/Plugin/Context/ContextDefinition.php property 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.
ControllerBase::entityManager core/lib/Drupal/Core/Controller/ControllerBase.php function 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.
Crypt::hashEquals core/lib/Drupal/Component/Utility/Crypt.php function in drupal:8.8.0 and is removed from drupal:9.0.0. Use PHP's built-in hash_equals() function instead. 1
Crypt::randomBytes core/lib/Drupal/Component/Utility/Crypt.php function in drupal:8.8.0 and is removed from drupal:9.0.0. Use PHP's built-in random_bytes() function instead. 1
D6VariableTranslation core/modules/migrate_drupal/src/Plugin/migrate/source/d6/D6VariableTranslation.php class in drupal:8.7.0 and is removed from drupal:9.0.0. Use \Drupal\migrate_drupal\Plugin\migrate\source\d6\VariableTranslation.
DatabaseWebTestBase core/modules/system/src/Tests/Database/DatabaseWebTestBase.php class in drupal:8.4.0 and is removed from drupal:9.0.0. Instead use \Drupal\Tests\system\Functional\Database\DatabaseTestBase.
DateField core/modules/datetime/src/Plugin/migrate/field/d6/DateField.php class in drupal:8.4.0 and is removed from drupal:9.0.0. Use \Drupal\datetime\Plugin\migrate\field\DateField instead. 1
DateFormatResourceTestBase core/modules/rest/tests/src/Functional/EntityResource/DateFormat/DateFormatResourceTestBase.php class in drupal:8.6.0 and is removed from drupal:9.0.0. Use Drupal\FunctionalTests\Rest\DateFormatResourceTestBase instead.
DateTestBase core/modules/datetime/src/Tests/DateTestBase.php class in drupal:8.4.0 and is removed from drupal:9.0.0. Use \Drupal\Tests\BrowserTestBase instead.
DateTimeHandlerTestBase core/modules/datetime/src/Tests/Views/DateTimeHandlerTestBase.php class in drupal:8.4.0 and is removed from drupal:9.0.0. Use \Drupal\Tests\BrowserTestBase.
DATETIME_DATETIME_STORAGE_FORMAT core/modules/datetime/datetime.module constant in drupal:8.5.0 and is removed from drupal:9.0.0. Use \Drupal\datetime\Plugin\Field\FieldType\DateTimeItemInterface::DATETIME_STORAGE_FORMAT instead.
datetime_date_default_time core/modules/datetime/datetime.module function 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.
DATETIME_DATE_STORAGE_FORMAT core/modules/datetime/datetime.module constant in drupal:8.5.0 and is removed from drupal:9.0.0. Use \Drupal\datetime\Plugin\Field\FieldType\DateTimeItemInterface::DATE_STORAGE_FORMAT instead.
datetime_range_view_presave core/modules/datetime_range/datetime_range.module function in drupal:8.5.0 and is removed from drupal:9.0.0.
DATETIME_STORAGE_TIMEZONE core/modules/datetime/datetime.module constant in drupal:8.5.0 and is removed from drupal:9.0.0. Use \Drupal\datetime\Plugin\Field\FieldType\DateTimeItemInterface::STORAGE_TIMEZONE instead.
date_iso8601 core/includes/common.inc function in drupal:8.7.0 and is removed from drupal:9.0.0. Use date('c', $date) instead.
dblog_view_presave core/modules/dblog/dblog.module function in drupal:8.4.0 and is removed from drupal:9.0.0.
DbUpdatesTrait core/modules/system/src/Tests/Update/DbUpdatesTrait.php trait in drupal:8.4.0 and is removed from drupal:9.0.0. Use \Drupal\FunctionalTests\Update\DbUpdatesTrait.
db_add_field core/includes/database.inc function 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); 1
db_add_index core/includes/database.inc function 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); 1
db_add_primary_key core/includes/database.inc function 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); 1
db_add_unique_key core/includes/database.inc function 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); 1
db_and core/includes/database.inc function 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'); 1
db_change_field core/includes/database.inc function 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); 1
db_close core/includes/database.inc function in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Database\Database::closeConnection($target). 1
db_condition core/includes/database.inc function 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); 1
db_create_table core/includes/database.inc function 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); 1
db_delete core/includes/database.inc function 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); 1
db_driver core/includes/database.inc function 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); 1
db_drop_field core/includes/database.inc function 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); 1
db_drop_index core/includes/database.inc function 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); 1
db_drop_primary_key core/includes/database.inc function 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); 1
db_drop_table core/includes/database.inc function 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); 1
db_drop_unique_key core/includes/database.inc function 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); 1
db_escape_field core/includes/database.inc function 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); 1
db_escape_table core/includes/database.inc function 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); 1
db_field_exists core/includes/database.inc function 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); 1
db_field_names core/includes/database.inc function 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); 1
db_field_set_default core/includes/database.inc function 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); 1
db_field_set_no_default core/includes/database.inc function 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); 1
db_find_tables core/includes/database.inc function 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); 1
db_ignore_replica core/includes/database.inc function in drupal:8.7.0 and is removed from drupal:9.0.0. Use \Drupal::service('database.replica_kill_switch')->trigger() instead. 1
db_index_exists core/includes/database.inc function 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); 1

Pages

Other projects