Problem/Motivation

#3213858: [META] Remove deprecated modules and themes from the Drupal 10 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 10.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 lots of stub issues with no activity.) Look carefully for duplicates.
  • Tag the issues with Deprecation Removal and file them against the 10.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

User interface changes

None.

API changes

Deprecated APIs will be removed.

Data model changes

None.

Comments

Gábor Hojtsy created an issue. See original summary.

andypost’s picture

Filed #3260615: Remove deprecated schema.inc removal of this and clean-up of other includes better to get in earlier to speed-up core tests and bootstrap

andypost’s picture

andypost’s picture

andypost’s picture

andypost’s picture

Status: Postponed » Active
andypost’s picture

andypost’s picture

andypost’s picture

andypost’s picture

quietone’s picture

@andypost thanks for adding the deprecation of migration system issue, which I was forgot to do, and probably caused the need for some rerolls later. :-(

Noting here that the migration issue removes code from the following non-migrate* modules.

  • comment
  • node
  • path
  • system
  • taxonomy
andypost’s picture

andypost’s picture

andypost’s picture

andypost’s picture

andypost’s picture

andypost’s picture

Issue summary: View changes

Updated IS with remaining issues, btw few ones still should be filed

Removed #3265121: Remove Symfony 4 RequestStack BC shim in 11.0.x as it now targeted to D11

andypost’s picture

Issue summary: View changes

There's some usage in tests

core/tests/Drupal/FunctionalTests/Image/ToolkitTestBase.php:14: * @deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. There is
core/tests/Drupal/Tests/AssertHelperTrait.php:12: * @deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. There is no
core/tests/Drupal/Tests/AssertHelperTrait.php:28:   * @deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. There is no
core/tests/Drupal/Tests/BrowserTestBase.php:638:   * @deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. Use
core/tests/Drupal/Tests/Traits/ExpectDeprecationTrait.php:10: * @deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use
core/tests/Drupal/Tests/UiHelperTrait.php:192:   * @deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use
core/tests/Drupal/Tests/UnitTestCase.php:110:   * @deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use
andypost’s picture

andypost’s picture

Issue summary: View changes
quietone’s picture

Issue summary: View changes
longwave’s picture

andypost’s picture

xjm’s picture

Issue summary: View changes
andypost’s picture

Issue summary: View changes

IS is cleaned a bit

andypost’s picture

andypost’s picture

Issue summary: View changes

removed #3265121 as it's for 11.x

andypost’s picture

andypost’s picture

Issue summary: View changes
andypost’s picture

Issue summary: View changes
andypost’s picture

Issue summary: View changes
catch’s picture

catch’s picture

Issue summary: View changes

I've just opened #3285131: Fix constructor deprecation in Drupal\Core\Theme\Registry::__construct(), which should have been straightforward but I think we made the original constructor change incorrectly.

Also opened #3285128: Remove deprecated code in Drupal\Core\UpdateUpdateRegistry which should be possible for a novice to tackle.

catch’s picture

Issue summary: View changes
catch’s picture

catch’s picture

Issue summary: View changes
longwave’s picture

Issue summary: View changes

Added the remaining constructors in #3285503: Remove deprecated code in constructors

catch’s picture

Issue summary: View changes
catch’s picture

catch’s picture

Issue summary: View changes

Actually, taking #3290810: Remove updates added prior to 9.4.0 (9.4.4 for ckeditor) and add 9.4.0 database dumps out again because it's not deprecated code removal and it has its own section in the 10.0.0-beta1 tracking issue.

andypost’s picture

Issue summary: View changes

clean-up IS

andypost’s picture

Issue summary: View changes
longwave’s picture

Still quite a few stragglers that don't have child issues yet - grep for drupal:10 and exclude drupal:11.

longwave’s picture

We have code in ajax.es6.js that has been deprecated since 8.6.0, but #2973400: Mark functions for wrapping Ajax response as deprecated was never completed - can we do this in 9.5.x for removal in 10.0.x?

catch’s picture

If we've got already-deprecated code that needs the deprecation documentation/trigger-error fixing, then that's fair game for 9.5.x for removal in 10.0.x still.

Spokje’s picture

...that has been deprecated since 8.6.0...

I'll see your 8.6.0 and raise you @todo Deprecated in Drupal 8.5.0
Note the very unorthodox use of @todo. Is this code "officially" deprecated?

#2926958: Remove revision-related methods from EntityStorageInterface
https://git.drupalcode.org/project/drupal/-/blob/9.5.x/core/lib/Drupal/C...

catch’s picture

8.5 might be from before we could actually deprecate things properly in core (deprecation tests etc.)

With something that old, we'd want a 9.5 issue to make the deprecation proper, if that shows there are no core usages, then maybe check for contrib usages, then we can decide if they should be for removal in 10.x or 11.x depending on how deprecated they really are. But either way better to fix the docs/trigger_error() in 9.5.x

Spokje’s picture

catch’s picture

Issue summary: View changes
longwave’s picture

Issue summary: View changes
catch’s picture

Issue summary: View changes

One more, not a straightforward removal:

#3293284: Throw an exception when Router::generate() is called.

catch’s picture

catch’s picture

Issue summary: View changes
xjm’s picture

Issue tags: +Drupal 10 beta blocker
Gábor Hojtsy’s picture

Issue summary: View changes

The first listed remaining task is resolved.

Gábor Hojtsy’s picture

andypost’s picture

Looks we should clone the issue for D11 to start collect issues for it. It will be easy to use for upcoming deprecations

Gábor Hojtsy’s picture

Gábor Hojtsy’s picture

catch’s picture

catch’s picture

Issue summary: View changes

Switching the tabbable issue from #3278625: [PP-1] Remove/deprecate jquery.tabbable.shim to #3296096: Update tabbable deprecation messages to 11.x since we have missed the boat on completing the deprecation of the library there.

catch’s picture

Issue summary: View changes
Gábor Hojtsy’s picture

The following @deprecated's are remainig in Drupal 10-dev (targeted at removal in Drupal 10), the last one is for testing purposes but the rest seem to be legit. Most of these don't seem to have a child issue here. Are they covered elsewhere for beta?

core/misc/ajax.es6.js:   * @deprecated in drupal:8.6.0 and is removed from drupal:10.0.0.
core/misc/ajax.es6.js:   * @deprecated in drupal:8.6.0 and is removed from drupal:10.0.0.
core/includes/bootstrap.inc: * @deprecated in drupal:8.3.0 and is removed from drupal:10.0.0.
core/modules/contextual/js/contextual.es6.js:     * @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. There is no
core/modules/contextual/js/contextual.es6.js:     * @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. There is no
core/modules/contextual/js/contextual.es6.js:   * @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. There is no
core/modules/contextual/js/toolbar/models/StateModel.es6.js:   * @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. There is no
core/modules/contextual/js/toolbar/views/AuralView.es6.js:   * @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. There is no
core/modules/contextual/js/toolbar/views/VisualView.es6.js:   * @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. There is no
core/modules/contextual/js/models/StateModel.es6.js:   * @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. There is no
core/modules/contextual/js/contextual.toolbar.es6.js:     * @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. There is
core/modules/contextual/js/views/AuralView.es6.js:   * @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. There is no
core/modules/contextual/js/views/VisualView.es6.js:   * @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. There is no
core/modules/contextual/js/views/RegionView.es6.js:   * @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. There is no
core/modules/contextual/js/views/KeyboardView.es6.js:   * @deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. There is no
core/modules/system/tests/modules/deprecation_test/deprecation_test.module: * @deprecated in drupal:8.4.0 and is removed from drupal:9.0.0. This is
catch’s picture

The contextual deprecations were added in #3277311: Deprecate and mark internal contextual JS API and would be removed in #3203920: Replace Contextual Links BackboneJS usage with VanillaJS equivalent. Backbone removal is marked as a 'should have' in #3145958: [META] Re-evaluate use of Backbone.js in core.

I think this means that we should ignore those contextual js deprecations until the last minute, and if the backbone issue doesn't land, then update the deprecation message for removal in 11.0.0 (which could happen during beta since it'd just be a string change). Maybe we need an explicit, postponed, issue for doing that though.

--

core/misc/ajax.es6.jsThe AJAX one looks like it never got finished properly to match the new js deprecations, it's mentioned in #3096679: JavaScript calls to deprecated APIs are not found (for Drupal 10) as a problem but I can't find a core issue - should probably have one.

--
core/includes/bootstrap.inc: * @deprecated in drupal:8.3.0 and is removed from drupal:10.0.0.
This is #2902895: [meta][no patch] Replace uses of REQUEST_TIME and time() with time service. If it doesn't get done, we should update the deprecation for removal in 11.0.0.

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

This is valid test fodder.

Gábor Hojtsy’s picture

Also grepped for all the E_USER_DEPRECATED and manually removed the ones that are based on my review part of the infrastructure to raise the deprecation errors or were Drupal 11 targeted. That resulted in these 4 remaining E_USER_DEPRECATED:

core/tests/Drupal/Tests/Listeners/DrupalListener.php:      @trigger_error('The ' . get_class($test) . '::$modules property must be declared protected. See https://www.drupal.org/node/2909426', E_USER_DEPRECATED);

core/tests/Drupal/FunctionalJavascriptTests/WebDriverTestBase.php:          @trigger_error("Not failing JavaScript test for JavaScript errors is deprecated in drupal:9.3.0 and is removed from drupal:10.0.0. This test had the following JavaScript errors: $all_errors. See https://www.drupal.org/node/3221100", E_USER_DEPRECATED);

core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditJavascriptTestBase.php:      @trigger_error('Calling ' . __METHOD__ . '() with 4 arguments is deprecated in drupal:9.1.0 and will throw an error in drupal:10.0.0. See https://www.drupal.org/project/drupal/issues/3037436', E_USER_DEPRECATED);

core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php:      @trigger_error('Calling ' . __METHOD__ . '() with 4 arguments is deprecated in drupal:9.1.0 and will throw an error in drupal:10.0.0. See https://www.drupal.org/project/drupal/issues/3037436', E_USER_DEPRECATED);

The second is #3293090: Fail JavaScript tests on JavaScript errors which I just RTBC-ed :D The rest I am not sure, the first one does not even say for when it is deprecated (to be removed).

Berdir’s picture

> $modules property must be declared protected

I've noticed this one still showing up in D10 instead of failing test.

Note that (probably because of the missing versions), it's also not discovered by either phpstan or rector, so your statistics and patches aren't including it. It's also very low impact and can't actually be enforced without custom PHP code, similar to the current warning. Because you can always make a protected property public in a child class, what you can't do is the opposite.

So it might be a good idea to move that to D11 (or just drop the message and maybe have a coding standard or phstan check for it to ensure that core complies). Also, the argumentation in https://www.drupal.org/node/2909426 about "lost developer time" is somewhat ironic as I'm fairly certain that at this point, a lot more developer time was spent on changing it than having to look up which one to use.

catch’s picture

catch’s picture

core/modules/quickedit/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php

Covered by #3227033: Remove Quick Edit from core.

Also opened #3301205: Replace the test class protected $modules deprecation error with a phpstan-drupal rule.

catch’s picture

Issue summary: View changes
catch’s picture

Issue summary: View changes
Gábor Hojtsy’s picture

catch’s picture

Status: Active » Fixed

Just committed #3293090: Fail JavaScript tests on JavaScript errors, which means this is done!

A lot of triage happened in here, so crediting people for that.

Berdir’s picture

Created one small follow-up/child issue: #3301663: Remove handling of node_type condition plugin in BlockForm::\Drupal\block\BlockForm::buildVisibilityInterface(), but I don't think we need to reopen this or anything, it's not a big deal, just a bit of dead code.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.