Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Usage of Drupal\pathauto\Plugin\Deriver\EntityAliasTypeDeriver will throw the following deprecation message with Core 8.6.x
.
Constructing a ContextDefinition object for an entity type is deprecated in Drupal 8.6.0. Use Drupal\Core\Plugin\Context\EntityContextDefinition instead. See https://www.drupal.org/node/2976400 for more information.
Comment | File | Size | Author |
---|---|---|---|
#16 | context-definition-deprecation-3004108-16.patch | 9.75 KB | Berdir |
#15 | context-definition-deprecation-3004108-13.patch | 8.5 KB | Berdir |
#8 | interdiff_5-7.txt | 1.24 KB | hugronaphor |
#8 | context-definition-deprecation-3004108-7.patch | 2.43 KB | hugronaphor |
#5 | interdiff-2-5.txt | 265 bytes | bobbygryzynger |
Comments
Comment #2
bobbygryzyngerAddresses the deprecation using guidance from the CR.
Comment #3
bobbygryzyngerComment #4
BerdirThanks. Note that I will not commit this soon as this is just a deprecation message and would mean that pathauto then requires 8.6. That is not going to happen soon just for a deprecation, especially since 8.5 still receives security updates until 8.7 is released.
Also, this should then also update the version .info.yml file, setting to needs work for that.
Comment #5
bobbygryzynger@berdir no problem, makes sense. I'm mostly just trying to prevent this message from popping up in my test suite.
The attached patch bumps the version to 8.6.
Comment #6
bobbygryzyngerComment #7
hugronaphor CreditAttribution: hugronaphor at Acrosto for manifesto commentedComment #8
hugronaphor CreditAttribution: hugronaphor at Acrosto for manifesto commentedBy now, there are more related context deprecation. context has to be replaced with context_definitions in annotation classes.
As of Drupal 8.7 with default
core/phpunit.xml.dist
the tests are failing and pretty much holds our dev workflow.Maybe a new major(not sure this is how you call it) release can be created which will require Drupal 8.7?
Comment #9
idebr CreditAttribution: idebr at iO commentedDrupal 8.5.x is no longer supported, so this issue can now be resolved while staying in sync with Drupal core supported versions.
The patch applies cleanly and solves the deprecation error.
Comment #10
BerdirExcept it can't, as the failing test shows. context_definition is an 8.7 deprecation :)
The patch needs to be updated to set 8.7 as the minimum version and I don't want to commit that yet.
> As of Drupal 8.7 with default core/phpunit.xml.dist the tests are failing and pretty much holds our dev workflow.
I'd strongly recommend to not rely on the default deprecation settings for projects. Those defaults are for drupal core, not projects built with it. These deprecations exist for a reason, contrib modules have no choice but to wait 6 month or so after new core version is out until they update their code, or they break the previous core version, which is problematic e.g. when you need to do a security release.
Comment #11
Kristen PolPer a Slack discussion with Gábor Hojtsy regarding usage of D9 tags (Drupal 9, Drupal 9 compatibility, Drupal 9 readiness, etc.), "Drupal 9 compatibility" should be used for contributed projects that need updating and "Drupal 9" was the old tag for D8 issues before the D9 branch was ready. Doing tag cleanup here based on that discussion.
Comment #12
BerdirSee #3042582: Drupal 9 Deprecated Code Report for Pathauto, lets merge this into that.
Comment #15
Berdir#3086586: Add new key core_version_requirement in pathauto.info.yml and #3099210: Add defaultTheme in tests extending BrowserTestBase. merged into this and fixed a few more things.
Comment #16
BerdirLets see if this passes on 8.7 and 8.8.
Comment #18
BerdirCommitted.
Comment #20
Sahana _N CreditAttribution: Sahana _N at Specbee commented