Problem/Motivation
#3013276: [META] Remove deprecated modules on the Drupal 9 branch deals with removing deprecated modules. This plan issue is to deal with all the rest of the deprecated code to be removed that are outside of deprecated modules: classes, methods, procedural functions and code paths that are not in wholly deprecated modules.
Some of these can just be deleted when 9.x opens, which might even be scriptable.
Proposed resolution
- Open issues only if you are going to submit a patch for them. (We don't want hundreds of stub issues with no activity.) Look carefully for duplicates.
- Tag the issues with Deprecation Removal and file them against the 9.0.x branch.
- For large APIs, a single issue to remove the whole API is best. While we don't usually recommend scoping issues by module instead of concept, in this case, the API provided by a module can be considered a single API, especially for smaller modules. Issues can also be grouped by core subsystem namespace (e.g. things in
core/lib/Drupal/Core/Foo/
). - Remove only:
- The module's own API.
- Legacy tests of the removed API.
Remaining tasks
Must have before Drupal 9
Remove or properly-deprecate for 10.x:
#3109480: Properly deprecate theme functions for Drupal 10
Not critical for Drupal 9
To be changed in #2807743: Switch from deprecation notice to warning for non-standard placeholders in FormattableMarkup::placeholderFormat()
core/tests/Drupal/Tests/Component/Render/FormattableMarkupTest.php: ['Alpha starting character: placeholder', ['placeholder' => 'replaced'], E_USER_DEPRECATED, 'Invalid placeholder (placeholder) in string: Alpha starting character: placeholder'],
core/tests/Drupal/Tests/Component/Render/FormattableMarkupTest.php: ['placeholder', ['placeholder' => 'replaced'], E_USER_DEPRECATED, 'Invalid placeholder (placeholder) in string: placeholder'],
core/lib/Drupal/Component/Render/FormattableMarkup.php: trigger_error('Invalid placeholder (' . $key . ') in string: ' . $string, E_USER_DEPRECATED);
User interface changes
None.
API changes
Deprecated APIs will be removed.
Data model changes
None.
Comments
Comment #2
pashupathi nath gajawada CreditAttribution: pashupathi nath gajawada as a volunteer and at Melity commentedOkay.
Comment #3
Gábor HojtsyComment #4
Wim LeersJust made #2893795: Remove serialization.module BC layers + #3034062: Remove hal.module BC layers + #2893804: Remove rest.module BC layers children of this.
Comment #6
xjmComment #7
xjmComment #8
xjmComment #9
xjmComment #10
xjmLendude and I discussed that we can't necessarily get rid of SimpleTest base tests just yet (e.g. ViewsTestBase) as these may be used by other modules and we are still finalizing how SimpleTest will be handled.
Comment #11
xjmComment #12
Wim Leers#2893804-56: Remove rest.module BC layers is passing tests!
I moved on to other modules in Drupal core that I either officially or non-officially maintain do not have BC layers to be removed:
big_pipe
ckeditor
dynamic_page_cache
page_cache
But for some of them, there are BC layers to be removed, and no issues or patches existed yet. So I filed issues and created patches for:
quickedit
: #3092433: Remove quickedit.module BC layerseditor
: #3092458: Remove editor.module BC layersjsonapi
: #3092459: Remove jsonapi.module BC layersComment #13
andypostComment #14
LendudeFixed the link in the IS to #3091462: [policy, no patch] Agree to purge WebTestBase extending *TestBase classes outside the Simpletest module from D9 which needs discussion if we want to move forward with clear steps of what to remove (and what not)
Comment #15
xjmComment #16
chr.fritschComment #17
amateescu CreditAttribution: amateescu for Pfizer, Inc. commentedComment #18
kim.pepperComment #19
mdupontComment #20
LendudeUpdated the IS to reflect the discussion in #3091462: [policy, no patch] Agree to purge WebTestBase extending *TestBase classes outside the Simpletest module from D9, removed the restriction on removing Simpletest test base classes.
Comment #21
Lendudeold page...set the parent back
Comment #22
andypostFiled #3097462: Remove uses of the [user:name] token to discus removal of widely used token
Comment #23
andypostRemoval entity_reference module needs #3062302: Properly deprecate the entity reference module
Comment #24
BerdirCreated a few patches for stuff below Drupal\Core, additionally to the already existing ones like utility, entity and path:
#3081145: Remove BC layers in the Plugin component
#3104306: Remove BC layers in the extension component
#3104307: Remove BC layers in various Drupal\Core components
Comment #25
DamienMcKennaTagging as a requirement for Drupal 9.0-beta1.
Comment #26
Gábor HojtsyMerged #3109746: Remove remaining @deprecated code in the datetime module and #3110315: Remove all @deprecated code from migrate_drupal module into the later. Added #3111344: Remove deprecated code from migrate module as there was no issue I found for that. There is also a bunch remaining deprecated stuff in migration plugins in some other modules, not yet sure where to slot that.
Comment #27
andypostFor comment module there's only follow-up left #3069260: Deprecate Drupal\comment\Plugin\migrate\source\d6\Comment::prepareComment().
So only taxonomy, datetime* and migrations left
Comment #28
Gábor HojtsyOpened #3111373: Remove deprecated migrate plugins from non-migrate modules for the remaining migration plugins.
Comment #29
mondrakePlease note that
Drupal\FunctionalTests\AssertLegacyTrait
has some deprecated methods, meant for removal in D10; however,trigger_error
and deprecation tests refer to removal in D9. This is due to undeprecation done in #3031580: Undeprecate \Drupal\FunctionalTests\AssertLegacyTrait and \Drupal\KernelTests\AssertLegacyTrait in Drupal 8 that left the docblock and the trigger_error comments out-of-sync.#3104372: Fix Drupal\FunctionalTests\AssertLegacyTrait inconsistent deprecation messages tries to address that.
Comment #30
Gábor HojtsyThere was 6 deprecated things in system module, 5 are simple global constants. Did not find an issue that would cover it. Opened #3111942: Remove all remaining @deprecated code from system module.
Comment #31
Gábor HojtsyAlso opened #3111947: Remove all @deprecated code from TwigExtension for a group of easy-win looking setters in TwigEnvironment.
Comment #32
alexpott#3111906: Remove deprecated AllowedTagsXssTrait is cleaning up one cross module class.
Comment #33
Gábor HojtsyWe are down to 63 instances of @deprecated with only one of them apparently for Drupal 10 so far:
There is still 120 uses of E_USER_DEPRECATED so I will not dump them here :D #3104372: Fix Drupal\FunctionalTests\AssertLegacyTrait inconsistent deprecation messages would resolve a bunch of those.
Comment #34
lauriiiOpened #3114116: Re-schedule removal of deprecated JavaScript code to Drupal 10 for re-scheduling
core/misc/ajax.es6.js
deprecations to be removed prior to Drupal 10.We can remove
core/assets/vendor/popperjs/popper.min.js.map
from the list because that is in a vendor library.Comment #35
Gábor HojtsyLooking at the mentions of @deprecated and E_USER_ERROR, most of them are down to #3069696: Remove BC layers from the entity system which is in turn postponed on #3099789: Remove the BC layer for revision metadata keys. Exciting!
Comment #36
catchFor the child issues of this issue I took a quick look a them all, these are a mixture of removals and redeprecations, they all need review/work/commit:
#2928994: Remove \Drupal\Core\Messenger\LegacyMessenger
#3114869: \Drupal\Core\Routing\Router::generate() is deprecated but it is on an interface
#3114974: \Drupal\migrate\Plugin\MigrateDestinationInterface::fields() $migration argument is deprecated
#3114239: Properly deprecate \Drupal\Core\StringTranslation\TranslationWrapper
#3110874: Remove BC layer for TestSetupTrait
#3069696: Remove BC layers from the entity system is unpostponed now.
This is 8.8/8.9-only, #3062302: Properly deprecate the entity reference module, the module was already made into a stub in 9.x
Comment #37
catchAnother one #3109480: Properly deprecate theme functions for Drupal 10.
Comment #38
xjmShouldn't a stub also be deprecated? So we could treat it as a 10.x deprecation if we're retaining the stub in D9. (For some reason I thought we had already gutted it in 8.x, but I guess not.)
Comment #39
catch@xjm yeah it has 'Deprecated' in .info.yml and it's hidden in the interface in 9.x. We also have a post update to uninstall it if it's still enabled.
We have to leave the stub in 9.x so that it can actually be uninstalled - otherwise it's missing module errors etc., but it is empty. Then it can finally be removed outright in 10.0.0
The 8.x for 9.x deprecations are still valid here though, because all the functionality has been removed from 9.x, so if a site really was relying on entity_reference plugins from prior to Drupal 8.0.0 (we deprecated the module in rc1), they'd need to sort that out prior to updating to 9.x. That never got done properly at the time because there was no way to do it.
Comment #40
Gábor HojtsyOnly 9 uses of @deprecated left for Drupal 9. This one will of course stay:
These 8 instances should still be removed:
The two block_place are #3084472: Remove Place Blocks module.
LegacyMessenger is #2928994: Remove \Drupal\Core\Messenger\LegacyMessenger.
TranslationWrapper is #3114239: Properly deprecate \Drupal\Core\StringTranslation\TranslationWrapper.
datetime module is #3110393: Remove @deprecated views code datetime_range.module
The bootstrap.inc one is about
const DRUPAL_PHP_FUNCTION_PATTERN
, do we have an issue for that yet?The Field PluginSettingsInterface is entirely deprecated. Do we have an issue for that yet?
The Rest ResourcePluginManager deprecation is about the getInstance() method. Do we have an issue yet?
Comment #41
longwaveDRUPAL_PHP_FUNCTION_PATTERN
is #3115143: Remove deprecated DRUPAL_PHP_FUNCTION_PATTERNComment #42
longwavePluginSettingsInterface looks really tricky because it is still used and extended heavily; PluginSettingsBase is the base of all Field API plugins and they still use the methods it provides.
Comment #43
longwaveWe missed a couple of spots in the Entity issue, so here is a followup: #3116103: Remove remaining deprecated code from Entity system
Comment #44
Gábor HojtsyReviewed ALL of the E_USER_DEPRECATED mentions left that are not explicitly for Drupal 10, here is the rundown. I have a couple that are not clear.
Testing deprecations, should stay as-is
Active deprecation runtime code or related code comment, should stay as-is
This is a utility for deprecating arrays, can probably stay around as-is.
Should be a future Drupal 10 deprecation, just a code comment now, can probably stay as-is.
core/lib/Drupal/Core/Database/Query/Select.php: // - Emit E_USER_DEPRECATED if term_access is used.
Does this stay as-is?
Should be removed. Do we have an issue?
core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php: @trigger_error('Drupal\Tests\BrowserTestBase::$defaultTheme is required in drupal:9.0.0 when using an install profile that does not set a default theme. See https://www.drupal.org/node/3083055, which includes recommendations on which theme to use.', E_USER_DEPRECATED);
To be removed in #3116103: Remove remaining deprecated code from Entity system.
To be removed in #2928994: Remove \Drupal\Core\Messenger\LegacyMessenger.
core/lib/Drupal/Core/Messenger/LegacyMessenger.php: @trigger_error('Adding or retrieving messages prior to the container being initialized was deprecated in Drupal 8.5.0 and this functionality will be removed before Drupal 9.0.0. Please report this usage at https://www.drupal.org/node/2928994.', E_USER_DEPRECATED);
To be removed in #3114869: \Drupal\Core\Routing\Router::generate() is deprecated but it is on an interface.
core/lib/Drupal/Core/Routing/Router.php: @trigger_error('Use the \Drupal\Core\Url object instead', E_USER_DEPRECATED);
Should be updated to Drupal 10.
core/lib/Drupal/Core/DependencyInjection/DeprecatedServicePropertyTrait.php: @trigger_error("The property $name ($service_name service) is deprecated in $class_name and will be removed before Drupal 9.0.0.", E_USER_DEPRECATED);
Should be removed, I don't think we have an issue.
core/modules/migrate_drupal/src/MigrationState.php: @trigger_error(sprintf("Using migration plugin definitions to determine the migration state of the module '%s' is deprecated in Drupal 8.7. Add the module to a migrate_drupal.yml file. See https://www.drupal.org/node/2929443", $source_module), E_USER_DEPRECATED);
To be removed in #3110393: Remove @deprecated views code datetime_range.module.
To be removed in #3084472: Remove Place Blocks module.
Comment #45
lauriiiIssue for the
FormattableMarkup
item: #2807743: Switch from deprecation notice to warning for non-standard placeholders in FormattableMarkup::placeholderFormat().Comment #46
Gábor HojtsyMerged the @deprecated and E_USER_DEPRECATED ones into the issue summary. Edit away :)
Comment #47
Gábor HojtsyFix markup.
Comment #48
Gábor Hojtsy#3115903: Remove test cruft from TestSiteInstallCommand and #3116103: Remove remaining deprecated code from Entity system landed.
Comment #49
Gábor HojtsyComment #50
Gábor HojtsyOpened #3116164: DeprecatedServicePropertyTrait should trigger deprecation for Drupal 10 in Drupal 9..
Comment #51
Gábor Hojtsy#3116164: DeprecatedServicePropertyTrait should trigger deprecation for Drupal 10 in Drupal 9. and #3115143: Remove deprecated DRUPAL_PHP_FUNCTION_PATTERN both landed. Removing from issue summary.
Comment #52
andypostDeprecatedArray
should stay (it is unused now) but was introduced as arrayAccess shim to pager in #2044435: Convert pager.inc to a serviceAs BC shim removed it's now unused but not deprecated
Comment #53
andypostto be removed in #3110874: Remove BC layer for TestSetupTrait
Comment #54
Gábor Hojtsy#3110874: Remove BC layer for TestSetupTrait landed. Removed from issue summary.
Comment #55
andypostFiled #3116213: Remove REST ResourcePluginManager::getInstance() and added to summary
Comment #56
Gábor HojtsyOpened #3116216: Remove deprecated MigrateState legacy procedure for the migrate part and proposed a patch. Probably it needs actual migrate people to review it. That should be the last one that did not have an issue I think.
Comment #57
andypostRemoval of #3116213: Remove REST ResourcePluginManager::getInstance()
Comment #58
Gábor HojtsyMerged code snippet for the same issues in the issue summary for easier scope review / scanning. Still need an issue for PluginSettingsInterface.
Comment #59
Gábor Hojtsy#2928994: Remove \Drupal\Core\Messenger\LegacyMessenger landed, woot!
Comment #60
catchComment #61
Gábor Hojtsy#3084472: Remove Place Blocks module landed.
Comment #62
Gábor Hojtsy#3114239: Properly deprecate \Drupal\Core\StringTranslation\TranslationWrapper landed.
Comment #63
Gábor Hojtsy@longwave re #42 I opened #3116553: Undeprecate Core/Field/PluginSettingsInterface as it is being used widely.
Comment #64
Gábor Hojtsy#3116553: Undeprecate Core/Field/PluginSettingsInterface as it is being used widely also landed. 4 issues to go and two of them are RTBC :)
Comment #65
Gábor HojtsyMerged the 2 datetime related snippets in the issue summary. Its 4 issues :) (Fixed the previous comment too).
Comment #66
Gábor Hojtsy#3116216: Remove deprecated MigrateState legacy procedure also landed. Down to 3 issues and one of them is RTBC :)
Comment #67
andypostWhat we gonna do with #3111506: Properly deprecate _access_rest_csrf route requirement it looks needs split
Comment #68
Gábor Hojtsy#3114869: \Drupal\Core\Routing\Router::generate() is deprecated but it is on an interface landed. Only two left.
Comment #69
Gábor HojtsyAaaand #3110393: Remove @deprecated views code datetime_range.module landed. So we are down to #3109480: Properly deprecate theme functions for Drupal 10! #drumroll
Comment #70
catchJust a note that if we stick with 9.0.x-removal in #3109480: Properly deprecate theme functions for Drupal 10, we are going to need a patch to actually remove theme function support and its test coverage in 9.0.x as well - the current patch only fixes the deprecation without actually removing.
That could be a follow-up, or a 9.0.x-only patch on that issue.
Comment #71
longwave#3097889: Remove deprecated theme functions exists to do the final removal.
Comment #72
Gábor Hojtsy#3109480: Properly deprecate theme functions for Drupal 10 is going in a Drupal 10 direction now.
As for removing @deprecated and E_USER_ERROR, we are all done in core at this point, eg.
Only testing code or 10-targets :) Same for E_USER_ERROR but there are more lines you need to look at :)
Comment #73
catchJust under four years later, lovely to mark this fixed.
Comment #74
xjmCrediting folks who helped with organizing the meta.