2x: The \Drupal\Core\Path\AliasManager class is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Instead, use \Drupal\path_alias\AliasManager. See https://drupal.org/node/3092086

    2x in ConditionsFormTest::testConditionsFormWidgets from Drupal\Tests\rules\Functional

Change record The Path Alias core subsystem has been moved to the "path_alias" module

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jonathan1055 created an issue. See original summary.

TR’s picture

Title: Replace deprecated \Drupal\Core\Path\AliasStorage and \Drupal\Core\Path\AliasManager » Replace deprecated AliasStorage and AliasManager when Drupal 8.8 becomes the lowest supported version
Status: Active » Postponed

I'm going to postpone this because it's going to be a long time before we can do this. I'll re-open it ~1 month ahead of time so that we can work on a patch at that time.

jonathan1055’s picture

OK, yes that's fine. I started to look at it, as those were the two new tests I wrote. I was concerned that I had introduced some deprecated code, but could not discover where I went wrong. It is also odd that the Actions and Conditions tests behave differently, so maybe that is an indication that the problem was further down in Core and not me adding new deprecated code.

TR’s picture

You could still roll a patch for this, so it's ready to go for June. But we can't commit it until then.

jonathan1055’s picture

After posting, I realised that the deprecations were nothing to do with how I had written then tests, but that these tests are now showing the use of the deprecated code in the four actions that involve aliases:

rules_entity_path_alias_create:entity:node
rules_path_alias_create
rules_path_alias_delete_by_alias
rules_path_alias_delete_by_path

and the two conditions:

rules_path_alias_exists
rules_path_has_alias

I may work on a patch, but not just yet as it is not top priotity. So anyone else is welcome to pick this up if they want to, just assign the issue to yourself when doing so, to avoid us duplicating effort.

TR’s picture

Title: Replace deprecated AliasStorage and AliasManager when Drupal 8.8 becomes the lowest supported version » Replace deprecated path.alias_manager and AliasManager when Drupal 8.8 becomes the lowest supported version
Issue summary: View changes

I removed the AliasStorage changes from this issue because that's really part of #3088489: Path aliases have been converted to revisionable entities, fix when Drupal 8.8 becomes the lowest supported version and the change record cited there.

This issue should just be about the change record The Path Alias core subsystem has been moved to the "path_alias" module

TR’s picture

TR’s picture

Issue summary: View changes

That worked, but it's hard to tell if those are all the changes necessary because the testbot doesn't show the deprecations.

jonathan1055’s picture

I have tested patch #7 locally and on Travis and can confirm that you have sucessfully removed
2x: The \Drupal\Core\Path\AliasManager class is deprecated in drupal:8.8.0

and as expected, we still have the
4x: \Drupal\Core\Path\AliasStorage is deprecated in drupal:8.8.0

If you want to run tests on d.o. and show deprecations you can add this change from #3089502-24: [meta] Rules deprecated code into your patch file. The output is long and not especially readable (it is summarised when I run tests locally and on Travis) but if you know what deprecation message you are looking for it can be searched for easily. It will cause the test to fail though, so need to run again without it to get a green.

jonathan1055’s picture

Status: Postponed » Needs review

We can now start planning on dropping core 8.7 support so un-postponing this. Let's start with an easy one. Patch in #7 still applies, but re-testing just to make sure all is OK.

TR’s picture

See my comment in #3137977-4: Replace assertInternalType() calls with dedicated methods when Drupal 8.8 becomes the lowest supported version

Yes, un-postponing is fine but I need to make a new release before committing this.

jonathan1055’s picture

Thanks for pointing me to that issue. Good plan for final 8.7 release before any more of this deprecation work.

I'll help with anything I can do, but also I will hold of un-postponing these issues, as you have already said you are not working on this module first. It would have been so helpful if DA had given us some separation between 8.7 being unsupported and D9 being released.

TR’s picture

It would have been so helpful if DA had given us some separation between 8.7 being unsupported and D9 being released.

Agree 100%. Even a week would have made a huge difference.

  • TR committed 7bfafcf on 8.x-3.x
    Issue #3101026 by TR: Replace deprecated path.alias_manager and...
TR’s picture

Status: Needs review » Fixed

Retested and committed.

jonathan1055’s picture

Thanks. I will update my Travis repo and check the deprecation count and messages. Will probably have to adjust the allowed count upwards, now that we have lots of new tests :-)

Status: Fixed » Closed (fixed)

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