Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293733

[meta] Remove all @deprecated functions marked "remove before 8.0"

$
0
0

Updated: Comment #0

Problem/Motivation

#2187735: Add removal information to docblock of all @deprecated functions ensured that most @deprecated functions were marked "will be removed before Drupal 8.0". Now we just need to live up to that promise.

Proposed resolution

Remove the functions, first by removing uses of the functions, then later by removing the functions themselves.

Search the code base for @deprecated to confirm that this issue has been resolved. Our aim is that no functions will be marked @deprecated unless they are in a vendor directory (i.e. not code that we should modify).

Remaining tasks

Remove the functions. All removal issues should have the @deprecated tag. This is tagged "revisit before release candidate" so that we know how much of a problem this is come release candidate time, but we can easily slip that to "revisit before release".

git grep --after-context 8 '@deprecated' | grep "function " | grep -v 'core/vendor' | rev | cut -c 2- | rev

Then a little bit of clean for a total of 196 deprecated functions:

File / FunctionRemove useRemove function
bootstrap.inc drupal_add_http_header($name, $value, $append = FALSE)#2184907: Remove uses of drupal_add_http_header and related functionsRemove function
bootstrap.inc drupal_get_http_header($name = NULL)#2184907: Remove uses of drupal_add_http_header and related functionsRemove function
bootstrap.inc _drupal_set_preferred_header_name($name = NULL)#2184907: Remove uses of drupal_add_http_header and related functionsRemove function
bootstrap.inc drupal_send_headers($default_headers = array(), $only_default = FALSE)#2184907: Remove uses of drupal_add_http_header and related functionsRemove function
bootstrap.inc drupal_page_header()#2184907: Remove uses of drupal_add_http_header and related functionsRemove function
bootstrap.inc check_plain($text)#2089331: [meta] Replace calls to check_plain() with Drupal\Component\Utility\String::checkPlain()#2297487: Remove the check_plain function
bootstrap.inc user_access()#2048171: [meta] Replace user_access() calls with $account->hasPermission() wherever possible.#2306429: Remove user_access()
bootstrap.inc watchdog($type, $message, array $variables = array(), $severity = WATCHDOG_NOTICE, $link = NULL)#2271251: Remove usages of watchdog() from non-form and non-controllers#2272467: Remove usages of watchdog() from procedural code#2272481: Remove usages of watchdog() from forms, plugins and controllers#2324791: Remove watchdog()
bootstrap.inc drupal_anonymous_user()#2185315: Remove deprecated drupal_anonymous_user() function#2185315: Remove deprecated drupal_anonymous_user() function
bootstrap.inc drupal_get_hash_salt()#2297497: Remove calls to drupal_get_hash_salt#2297499: Remove the drupal_get_hash_salt function
bootstrap.inc module_list()#2045917: Replace all module_list() deprecated function calls.#2300077: Remove module_list() function
bootstrap.inc module_implements($hook)#2045919: Replace all module_implements() deprecated function calls.#2300081: Remove module_implements() function
bootstrap.inc module_invoke($module, $hook)#1916134: Remove module_* deprecated functions#2330181: Remove bootstrap.inc module_invoke().
bootstrap.inc module_invoke_all($hook)#2045923: Replace all module_invoke_all() deprecated function calls in procedural code.#2055371: Replace all module_invoke_all() deprecated function calls in OO codeAlready removed
bootstrap.inc drupal_alter($type, &$data, &$context1 = NULL, &$context2 = NULL)#2045927: Replace all drupal_alter() deprecated function calls.Already removed
bootstrap.inc module_exists($module)#2045931: Replace all module_exists() deprecated function calls.Already removed
bootstrap.inc module_hook($module, $hook)#2045935: Replace all module_hook() deprecated function calls.Already removed
bootstrap.inc language($type)#2070369: Remove all calls to deprecated function language()Already removed
bootstrap.inc language_list($flags = Language::STATE_CONFIGURABLE)#2166915: Remove uses of deprecated language functions in tests and procedural code#2225427: Remove remaining uses of deprecated language functions (mostly in object oriented code)#2328293: Remove usage of language_list()
bootstrap.inc language_load($langcode)#2166915: Remove uses of deprecated language functions in tests and procedural code#2225427: Remove remaining uses of deprecated language functions (mostly in object oriented code)#2328293: Remove usage of language_list()
bootstrap.inc language_default()#2166915: Remove uses of deprecated language functions in tests and procedural code#2225427: Remove remaining uses of deprecated language functions (mostly in object oriented code)Remove function
bootstrap.inc arg($index = NULL, $path = NULL)#788900: Deprecate and remove usages of arg()Already removed
bootstrap.inc drupal_check_memory_limit($required, $memory_limit = NULL)Already removed#2297533: Remove drupal_check_memory_limit function
bootstrap.inc lock()#2044367: Replace calls to lock() with \Drupal::lock()Already removed
common.inc format_plural($count, $singular, $plural, array $args = array(), array $options = array())#2149195: Replace format_plural with \Drupal::translation()->formatPlural()#2309737: Remove deprecated format_plural usageRemove function
common.inc parse_size($size)Already removed#2295715: Remove parse_size() function as it is no longer used.
common.inc format_interval($interval, $granularity = 2, $langcode = NULL)#2149197: Replace format_interval with \Drupal::service('date')->formatInterval()#2308783: Remove format_interval()
common.inc _drupal_add_css($data = NULL, $options = NULL)#2073819: [META] Remove direct calls to drupal_add_css()Remove function
common.inc _drupal_add_js($data = NULL, $options = NULL)#2073823: [META] Remove drupal_add_js() callsRemove function
common.inc drupal_json_encode($var)#2093161: Remove all calls to drupal_json_encode() in favour of \Drupal\Component\Utility\Json::encode()Already removed
common.inc drupal_json_decode($var)#2093173: Remove all calls to drupal_json_decode(), use \Drupal\Component\Utility\Json::decode()Already removed
common.inc drupal_get_private_key()#2297535: Remove drupal_get_private_key#2297535: Remove drupal_get_private_key
common.inc drupal_get_token($value = '')#2293541: Remove *_token deprecated functions#2293541: Remove *_token deprecated functions
common.inc drupal_valid_token($token, $value = '')#2293541: Remove *_token deprecated functions#2293541: Remove *_token deprecated functions
common.inc element_info($type)#2226621: Remove usage of element_*()#2226621: Remove usage of element_*()
common.inc element_info_property($type, $property_name, $default = NULL)#2226621: Remove usage of element_*()#2226621: Remove usage of element_*()
common.inc element_property($key)#2226621: Remove usage of element_*()#2226621: Remove usage of element_*()
common.inc element_properties($element)#2226621: Remove usage of element_*()#2226621: Remove usage of element_*()
common.inc element_child($key)#2226621: Remove usage of element_*()#2226621: Remove usage of element_*()
common.inc element_children(&$elements, $sort = FALSE)#2226621: Remove usage of element_*()#2226621: Remove usage of element_*()
common.inc element_get_visible_children(array $elements)#2226621: Remove usage of element_*()#2226621: Remove usage of element_*()
common.inc element_set_attributes(array &$element, array $map)#2226621: Remove usage of element_*()#2226621: Remove usage of element_*()
entity.inc entity_load_by_uuid($entity_type_id, $uuid)#2119481: Inject EntityManager dependency into UuidResolver#2119481: Inject EntityManager dependency into UuidResolver
entity.inc entity_get_controller($entity_type)Already RemovedAlready Removed
entity.inc entity_access_controller($entity_type)Already RemovedAlready Removed
errors.inc format_backtrace(array $backtrace)Already RemovedAlready Removed
form.inc drupal_get_form($form_arg)#2121175: Remove usage of drupal_get_form()Remove function
form.inc drupal_build_form($form_id, &$form_state)#2300581: Remove drupal_build_form()#2300581: Remove drupal_build_form()
form.inc form_state_defaults()Already removedAlready removed
form.inc drupal_rebuild_form($form_id, &$form_state, $old_form = NULL)Already removedAlready removed
form.inc form_get_cache($form_build_id, &$form_state)Remove UseRemove function
form.inc form_set_cache($form_build_id, $form, $form_state)Remove UseRemove function
form.inc drupal_form_submit($form_arg, &$form_state)Remove UseRemove function
form.inc drupal_retrieve_form($form_id, &$form_state)Already removed#2301593: Remove drupal_retrieve_form() as it is deprecated
form.inc drupal_process_form($form_id, &$form, &$form_state)#2335673: Remove usage of drupal_process_form().Remove function
form.inc drupal_prepare_form($form_id, &$form, &$form_state)Remove Use - Still mentioned in commentsAlready removed
form.inc drupal_validate_form($form_id, &$form, &$form_state)Already removedAlready removed
form.inc drupal_redirect_form($form_state)Already removedAlready removed
form.inc form_execute_handlers($type, &$form, &$form_state) #2278403: Remove uses of form_execute_handlers()Remove function
form.inc form_set_error($name, array &$form_state, $message = '')#2297875: Replace calls to form_set_error() to $form_state->setErrorByName()#2297919: Remove form_set_error()
form.inc form_clear_error(array &$form_state)Already RemovedAlready Removed
form.inc form_get_errors(array &$form_state)#2333353: Remove usage of form_get_errors().#2335189: Remove form.inc form_get_errors().
form.inc form_get_error($element, array &$form_state)Already Removed#2330423: Remove form.inc form_get_error().
form.inc form_error(&$element, array &$form_state, $message = '')#2334383: Remove usage of form_error().Already removed
form.inc form_builder($form_id, &$element, &$form_state)Remove Use - still mentioned in commentsRemove function
form.inc form_set_value($element, $value, &$form_state)#2354597: Remove usage of form_set_value().Remove function
form.inc form_options_flatten($array)#2341461: Remove usage of form_options_flatten().Remove function
module.inc module_install($module_list, $enable_dependencies = TRUE)Already removedRemove function
module.inc module_uninstall($module_list = array(), $uninstall_dependents = TRUE)Already removedRemove function
path.inc path_is_admin($path)Remove Use -Still mentioned in comments#2300817: Remove path_is_admin() as it is deprecated
theme.inc drupal_theme_access($theme)#2151469: Clean-up usage of deprecated list_themes(), drupal_find_base_themes(), theme_enable(), theme_disable(), _system_rebuild_theme_data() in favor of theme_handler serviceRemove function
theme.inc list_themes($refresh = FALSE)#2151469: Clean-up usage of deprecated list_themes(), drupal_find_base_themes(), theme_enable(), theme_disable(), _system_rebuild_theme_data() in favor of theme_handler serviceRemove function
theme.inc theme_enable($theme_list)#2151469: Clean-up usage of deprecated list_themes(), drupal_find_base_themes(), theme_enable(), theme_disable(), _system_rebuild_theme_data() in favor of theme_handler serviceRemove function
theme.inc theme_disable($theme_list)#2151469: Clean-up usage of deprecated list_themes(), drupal_find_base_themes(), theme_enable(), theme_disable(), _system_rebuild_theme_data() in favor of theme_handler serviceRemove function
utility.inc drupal_var_export($var, $prefix = '')Remove UseRemove function
Drupal.php public static getContainer()Remove UseRemove function
Drupal/Core/Routing/UrlGeneratorInterface.php public generateFromPath($path = NULL, $options = array())Remove UseRemove function
Drupal/Core/Routing/UrlGeneratorInterface.php public getPathFromRoute($name, $parameters = array())Remove UseRemove function
Drupal/Core/Url.php public getInternalPath()Remove UseRemove function
comment/comment.module comment_load($cid, $reset = FALSE)#2297475: Remove calls to comment_load#2297479: Remove comment_load function
comment/comment.module function comment_load_multiple(array $cids = NULL, $reset = FALSE) {Already removed#2297481: Remove comment_load_multiple
comment/comment.module comment_num_new()#2097123: Deprecate comment_num_new() in favour of method on CommentManager#2296839: Remove deprecated comment_num_new()
comment/comment.module comment_get_display_ordinal((Already removed#2303879: Remove comment_get_display_ordinal()
comment/comment.module comment_get_display_page()Already removed#2303883: Remove comment_get_display_page()
comment/comment.module comment_new_page_count()Already removed#2303887: Remove comment_new_page_count()
content_translation/content_translation.pages.inc content_translation_overview(EntityInterface $entity)#2224607: Move all functions from content_translation.pages.inc file to Drupal\content_translation\Controller\ContentTranslationController classRemove function
content_translation/content_translation.pages.inc content_translation_add_page(EntityInterface $entity, Language $source = NULL, Language $target = NULL)#2224607: Move all functions from content_translation.pages.inc file to Drupal\content_translation\Controller\ContentTranslationController classRemove function
content_translation/content_translation.pages.inc content_translation_edit_page(EntityInterface $entity, Language $language = NULL)#2224607: Move all functions from content_translation.pages.inc file to Drupal\content_translation\Controller\ContentTranslationController classRemove function
file/file.module file_load_multiple(array $fids = NULL, $reset = FALSE)#2352979: Remove file_load_multiple from file/file.moduleRemove function
file/file.module file_load($fid, $reset = FALSE)#2352987: Remove file_load from file/file.moduleRemove function
file/file.module file_usage()Already removed#2294251: Remove file_usage from file module
file/tests/file_module_test/file_module_test.module file_module_test_form($form, &$form_state, $tree = TRUE, $extended = TRUE, $multiple = FALSE, $default_fids = NULL)Already removedAlready removed
language/language.module language_access_language_edit_or_delete($language)use removed in #2003592: Convert language_admin_add_form and language_admin_edit_form to a Controllers, #1946426: Convert all of confirm_form() in language.admin.inc to the new form interface#2299253: Remove language_access_language_edit_or_delete function
locale/locale.pages.inc locale_translation_status_form($form, &$form_state)Already removedAlready removed
menu_link/menu_link.module menu_link_load($mlid = NULL, $reset = FALSE)#2225347: [META] Replace calls to ENTITY_TYPE_load() and ENTITY_TYPE_load_multiple() with static method callsRemove function
menu_link/menu_link.module menu_link_load_multiple(array $mlids = NULL, $reset = FALSE)#2225347: [META] Replace calls to ENTITY_TYPE_load() and ENTITY_TYPE_load_multiple() with static method callsRemove function
node/node.module node_type_get_types()#2322639: Replace all instances of node_type_load(), node_type_get_types(), entity_load('node_type') and entity_load_multiple('node_type') with static method callsRemove function
node/node.module node_type_load($name)#2225347: [META] Replace calls to ENTITY_TYPE_load() and ENTITY_TYPE_load_multiple() with static method callsRemove function
node/node.module node_load_multiple(array $nids = NULL, $reset = FALSE)#2225347: [META] Replace calls to ENTITY_TYPE_load() and ENTITY_TYPE_load_multiple() with static method callsRemove function
node/node.module node_load($nid = NULL, $reset = FALSE)#2225347: [META] Replace calls to ENTITY_TYPE_load() and ENTITY_TYPE_load_multiple() with static method callsRemove function
user/user.module user_authenticate($name, $password)Already Removed#2306165: Remove user_authenticate()
user/user.module user_format_name(AccountInterface $account)#2311219: Remove usage of function user_format_name()#2311221: Remove function user_format_name()
user_access($string, AccountInterface $account = NULL)#2062043: Replace user_access() calls with $account->hasPermission() in core files#2306429: Remove user_access()
shortcut/shortcut.admin.inc shortcut_set_switch($form, &$form_state, $account = NULL)Already removedAlready removed
system/system.module system_rebuild_theme_data()Remove UseRemove function
system/tests/modules/ajax_test/ajax_test.module ajax_test_render()#2066445: Convert a bunch of AjaxResponse callbacks in system.module's test's ajax_test.module to a new style controller#2066445: Convert a bunch of AjaxResponse callbacks in system.module's test's ajax_test.module to a new style controller
system/tests/modules/ajax_test/ajax_test.module ajax_test_order()#2066445: Convert a bunch of AjaxResponse callbacks in system.module's test's ajax_test.module to a new style controller#2066445: Convert a bunch of AjaxResponse callbacks in system.module's test's ajax_test.module to a new style controller
system/tests/modules/ajax_test/ajax_test.module ajax_test_error()#2066445: Convert a bunch of AjaxResponse callbacks in system.module's test's ajax_test.module to a new style controller#2066445: Convert a bunch of AjaxResponse callbacks in system.module's test's ajax_test.module to a new style controller
system/tests/modules/ajax_test/ajax_test.module ajax_test_dialog_close()#2066445: Convert a bunch of AjaxResponse callbacks in system.module's test's ajax_test.module to a new style controller#2066445: Convert a bunch of AjaxResponse callbacks in system.module's test's ajax_test.module to a new style controller
system/tests/modules/batch_test/batch_test.module batch_test_simple_form()Already removedAlready removed
update/update.fetch.inc update_fetch_data_batch(&$context)Already done#2306437: Remove update_fetch_data_batch
views/views.module views_get_plugin_definitions()Already done#2306471: Remove views_get_plugin_definitions()
views/views.module views_fetch_plugin_names($type, $key = NULL, $base = array())Already done#2306469: Remove views_fetch_plugin_names()
views/views.module views_plugin_list()Already done#2306545: Remove views_plugin_list()
views/views.module views_get_enabled_display_extenders()Already Removed#2353195: Remove views_get_enabled_display_extenders
bootstrap.inc drupal_bootstrap()N/A#2347625: Remove drupal_bootstrap and drupal_get_bootstrap_phase
bootstrap.inc drupal_get_bootstrap_phase()#2347625: Remove drupal_bootstrap and drupal_get_bootstrap_phase#2347625: Remove drupal_bootstrap and drupal_get_bootstrap_phase
views/views.module views_get_all_views()Already removedhttps://www.drupal.org/node/2353011#comment-9230381
taxonomy/taxonomy.module taxonomy_term_load_parents_all()Already removed#2353013: Remove taxonomy_term_load_parents_all from taxonomy/taxonomy.module

User interface changes

None

API changes

Several API functions removed.
No @deprecated API functions remaining.


Viewing all articles
Browse latest Browse all 293733

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>