Deprecated - 8.9.x - drupal

Primary tabs

Title File name Deprecation Type Direct uses Namespaced uses Overrides Use statements
db_insert 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 insert() on it. For example, $injected_database->insert($table, $options);

function 1
db_like 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 escapeLike() on it. For example, $injected_database->escapeLike($string);

function 1
db_merge 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 merge() on it. For example, $injected_database->merge($table, $options);

function 1
db_next_id 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 nextId() on it. For example, $injected_database->nextId($existing_id);

function 1
db_or 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 OR conjunction: new Condition('OR');

function 1
db_query 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 query() on it. For example, $injected_database->query($query, $args, $options);

function 1
db_query_range 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 queryRange() on it. For example, $injected_database->queryRange($query, $from, $count, $args, $options);

function
db_query_temporary 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 queryTemporary() on it. For example, $injected_database->queryTemporary($query, $args, $options);

function 1
db_rename_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 renameTable() on it. For example, $injected_database->schema()->renameTable($table, $new_name);

function 1
db_select 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 select() on it. For example, $injected_database->select($table, $alias, $options);

function 1
db_set_active core/includes/database.inc

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

function 1
db_table_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 tableExists() on it. For example, $injected_database->schema()->tableExists($table);

function 1
db_transaction 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 startTransaction() on it. For example, $injected_database->startTransaction($name);

function 1
db_truncate 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 truncate() on it. For example, $injected_database->truncate($table, $options);

function 1
db_update 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 update() on it. For example, $injected_database->update($table, $options);

function 1
db_xor 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 a XOR conjunction: new Condition('XOR');

function 1
DedupeBase core/modules/migrate/src/Plugin/migrate/process/DedupeBase.php

in drupal:8.4.0 and is removed from drupal:9.0.0. Use \Drupal\migrate\Plugin\migrate\process\MakeUniqueBase instead.

class
DedupeEntity core/modules/migrate/src/Plugin/migrate/process/DedupeEntity.php

in drupal:8.4.0 and is removed from drupal:9.0.0. Use \Drupal\migrate\Plugin\migrate\process\MakeUniqueEntityField instead.

class 1
DeleteComment core/modules/comment/src/Plugin/Action/DeleteComment.php

in drupal:8.6.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Action\Plugin\Action\DeleteAction instead.

class
DeleteNode core/modules/node/src/Plugin/Action/DeleteNode.php

in drupal:8.6.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Action\Plugin\Action\DeleteAction instead.

class
deprecation_test_function core/modules/system/tests/modules/deprecation_test/deprecation_test.module

in drupal:8.4.0 and is removed from drupal:9.0.0. This is the deprecation message for deprecated_test_function().

function 4
DisplayPluginBase::applyDisplayCachablityMetadata core/modules/views/src/Plugin/views/display/DisplayPluginBase.php

in drupal:8.4.0 and is removed from drupal:9.0.0. Use DisplayPluginBase::applyDisplayCacheabilityMetadata instead.

function
Drupal::entityManager core/lib/Drupal.php

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal::entityTypeManager() instead in most cases. If the needed method is not on \Drupal\Core\Entity\EntityTypeManagerInterface, see the deprecated \Drupal\Core\Entity\EntityManager to find the correct interface or service.

function 6
Drupal::l core/lib/Drupal.php

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Link::fromTextAndUrl() instead.

function 1
Drupal::url core/lib/Drupal.php

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead create a \Drupal\Core\Url object directly, for example using Url::fromRoute().

function 1
DrupalKernelInterface::prepareLegacyRequest core/lib/Drupal/Core/DrupalKernelInterface.php

in drupal:8.0.0 and is removed from drupal:9.0.0. Use DrupalKernel::boot() and DrupalKernel::preHandle() instead.

function 1
DRUPAL_ANONYMOUS_RID core/includes/bootstrap.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Use Drupal\Core\Session\AccountInterface::ANONYMOUS_ROLE or \Drupal\user\RoleInterface::ANONYMOUS_ID instead.

constant
DRUPAL_AUTHENTICATED_RID core/includes/bootstrap.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Use Drupal\Core\Session\AccountInterface::AUTHENTICATED_ROLE or \Drupal\user\RoleInterface::AUTHENTICATED_ID instead.

constant
drupal_basename core/includes/file.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\File\FileSystem::basename().

function 1
drupal_check_incompatibility core/includes/common.inc

in drupal:8.7.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Extension\Dependency::isCompatible() instead.

function 1
drupal_chmod core/includes/file.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\File\FileSystem::chmod().

function 1
drupal_classloader_register core/includes/bootstrap.inc

in drupal:8.8.0 and is removed from drupal:9.0.0. Use the class loader as injected service instance to register the namespace:

$this->classLoader
    ->addPsr4('Drupal\\' . $name . '\\', \Drupal::root() . '/' . $path . '/src');

or the following code if the service cannot be injected:

\Drupal::service('class_loader')->addPsr4('Drupal\\' . $name . '\\', \Drupal::root() . '/' . $path . '/src');
function 1
drupal_clear_css_cache core/includes/common.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Asset\AssetCollectionOptimizerInterface::deleteAll().

function
drupal_clear_js_cache core/includes/common.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Asset\AssetCollectionOptimizerInterface::deleteAll().

function
drupal_dirname core/includes/file.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\File\FileSystem::dirname().

function 1
drupal_get_destination core/includes/common.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Use the redirect.destination service.

function
drupal_get_messages core/includes/bootstrap.inc

in drupal:8.5.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Messenger\MessengerInterface::all() or \Drupal\Core\Messenger\MessengerInterface::messagesByType() instead.

function 1
drupal_get_profile core/includes/bootstrap.inc

in drupal:8.3.0 and is removed from drupal:9.0.0. Use the install_profile container parameter or \Drupal::installProfile() instead. If you are accessing the value before it is written to configuration during the installer use the $install_state global. If you need to access the value before container is available you can use BootstrapConfigStorageFactory to load the value directly from configuration.

function 1
drupal_get_user_timezone core/includes/bootstrap.inc

in drupal:8.8.0 and is removed from drupal:9.0.0. Use date_default_timezone_get() instead.

function 1
drupal_http_header_attributes core/includes/common.inc

in drupal:8.7.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Render\HtmlResponseAttachmentsProcessor::formatHttpHeaderAttributes() instead.

function 1
drupal_installation_attempted core/includes/bootstrap.inc

in drupal:8.8.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Installer\InstallerKernel::installationAttempted() instead.

function 1
drupal_install_config_directories core/includes/install.inc

in drupal:8.8.0 and is removed from drupal:9.0.0. There is no replacement.

function
drupal_mkdir core/includes/file.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\File\FileSystem::mkdir().

function 1
drupal_move_uploaded_file core/includes/file.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\File\FileSystem::moveUploadedFile().

function 1
DRUPAL_PHP_FUNCTION_PATTERN core/includes/bootstrap.inc

in drupal:8.8.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Extension\ExtensionDiscovery::PHP_FUNCTION_PATTERN instead.

constant
drupal_placeholder core/includes/bootstrap.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Component\Render\FormattableMarkup or Twig's "placeholder" filter instead. Note this method should not be used to simply emphasize a string and therefore has few valid use-cases. Note also, that this method does not mark the string as safe.

function
drupal_pre_render_link core/includes/common.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Render\Element\Link::preRenderLink().

function
drupal_pre_render_links core/includes/common.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Render\Element\Link::preRenderLinks() instead.

function
drupal_process_states core/includes/common.inc

in drupal:8.8.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Form\FormHelper::processStates() instead.

function 1
drupal_realpath core/includes/file.inc

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\File\FileSystem::realpath().

function 1

Other projects


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