Problem/Motivation

In #3084983: Move all the code related to path aliases to a new (required) "path_alias" module the core Path Alias subsystem was deprecated in favor of a new, required, path_alias module. We need to get rid of the legacy code and make the path_alias module optional.

Proposed resolution

Do it

Remaining tasks

TBD

User interface changes

None

API changes

TBD

Data model changes

None

Release notes snippet

TODO

Comments

plach created an issue. See original summary.

berdir’s picture

> We need to get rid of the legacy code and make the path_alias module optional.

This needs to be split up IMHO.

Getting rid of the legacy code is something we need to do for 9.0 and can start with once 8.8.0 is out because then we'll be removing support for updating from versions earlier than that. Then working on making it optional will most likely have to wait until 9.1+.

Cross-referencing #3093747: Add alias process service back (deprecated) and improve DX around BC path_alias services since that moves the @todo for removing the legacy service definitions around.

berdir’s picture

Also, not strictly postponed anymore although it probably makes sense to wait for the other issue to land as well as removing the upgrade path, so I suppose still and leaving it at that.

Also moving below the meta issue to remove deprecated code.

berdir’s picture

StatusFileSize
new68.82 KB

First patch, based on #3094292: Remove usages of deprecated path alias services and clear "DeprecationListenerTrait" entries. Felt the urge to remove all that code again after working on the issues leading to this point ;)

This will fail hard in the upgrade path, we need to remove that first and work with database dumps that are based on 8.8.0.

This mostly moves code and doesn't remove except the actual BC layer and tests for it.

plach’s picture

Title: [PP-1] Remove legacy Path Alias subsystem and make the "path_alias" module optional » Remove legacy Path Alias subsystem and make the "path_alias" module optional
Status: Postponed » Needs work

All blockers are in

berdir’s picture

Status: Needs work » Postponed

Actually has been reverted, but that's the the only blocker, it is still blocked on removing the D8 upgrade path: #3087644: Remove Drupal 8 updates up to and including 88**.

berdir’s picture

StatusFileSize
new104.09 KB

Forgot to actually remove a bunch of empty or practically empty classes and their services.

berdir’s picture

StatusFileSize
new117.05 KB

So, earlier patches were so horrible that they broke testbot. Berdir--.

This seems much better so far with a bunch of manually executed functional and kernel tests, lets try again.

berdir’s picture

Status: Postponed » Needs work

Turns out the update path tests aren't failing because nothing seems to actively call one of the removed services and the event subscribers are gone, at least not with just core and the path that we're testing.

Will have a look at the remaining fails, but I suppose it still makes sense to wait on the other issue before we commit it then.

plach’s picture

Title: Remove legacy Path Alias subsystem and make the "path_alias" module optional » Remove legacy Path Alias subsystem
Issue tags: +Needs followup

Thanks @Berdir!

+++ b/core/core.services.yml
@@ -461,13 +461,6 @@ services:
-  path.alias_manager:

We're missing the path.alias_storage service :)

Tagging as needing follow-up to make path_alias optional, I still have some code somewhere that could be used as a starting point. I'll create the issue later if none beats me to it.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new126.15 KB
new7.91 KB

Removing the deprecated path hooks, the path.alias_storage service definition and also adding path_alias to a few failing kernel tests which all had a loop over all modules including workspaces and that was unhappy about path_alias not being installed.

We should be able to remove these again once we make it actually optional, but this shows that the workspaces subscriber will then need to change this an optional dependency.

Status: Needs review » Needs work

The last submitted patch, 11: remove-path-alias-bc-3092090-11.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

amateescu’s picture

Yup, it makes sense to make the path alias part of WorkspaceRequestSubscriber optional. Maybe the easiest way to do that is to move it to another class/service which is registered dynamically in WorkspacesServiceProvider?

plach’s picture

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new125.35 KB

Reroll, lets see if this works now.

berdir’s picture

wim leers’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new455 bytes
new125.35 KB
+++ b/core/modules/path_alias/src/AliasManager.php
@@ -2,9 +2,298 @@
+class AliasManager implements AliasManagerInterface {
+
+
+  /**

Übernit: double empty line. Fixed.


This looks great. 80% of it is following the pattern of class Undeprecated extends Deprecated {}class Undeprecated {…………} and copying over all the code from Deprecated into Undeprecated. That means the patch seems enormous, but it's actually following a steady pattern.

I feel like an asshole for finding a single nit but … hey … what can I do about it? 😅 I did actually find more nits but they are all pre-existing problems, and fixing those would interfere with the "just copy code verbatim" pattern I just described.

So: 🚢

  • catch committed 474a690 on 9.0.x
    Issue #3092090 by Berdir, Wim Leers, plach, amateescu: Remove legacy...
catch’s picture

Status: Reviewed & tested by the community » Fixed
StatusFileSize
new2.27 KB

Fixed some cs issues on commit (see commit.txt).

Committed 474a690 and pushed to 9.0.x. Thanks!

Status: Fixed » Closed (fixed)

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