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.
This was discovered while working on #2412669: Remove drupal_static from BookManager.
Problem/Motivation
The BackendChain
service constructor looks like:
public function __construct($bin) {
}
This is forcing a service definition to declare arguments, in *.services.yml
, such as:
book.cache:
class: Drupal\Core\Cache\BackendChain
arguments: ['']
...
or...
book.cache:
class: Drupal\Core\Cache\BackendChain
arguments: ['whatever arbitrary string...']
...
The parameter is not used and not needed.
Proposed resolution
Make the parameter optional and deprecate it. Will be removed in 9.0.0.
Remaining tasks
None.
User interface changes
None.
API changes
The BackendChain
constructor parameter is optional and deprecated.
Data model changes
None.
Release notes snippet
None.
Comment | File | Size | Author |
---|---|---|---|
#10 | 3061117-7.patch | 3.44 KB | claudiu.cristea |
Comments
Comment #2
claudiu.cristeaComment #3
claudiu.cristeaPatch.
Comment #4
claudiu.cristeaComment #6
claudiu.cristeaRemove the usage of deprecated parameter from tests.
Comment #7
darrenwh CreditAttribution: darrenwh as a volunteer and at Investis Digital commentedI think a test should be in place to test that the deprecation message is shown correctly, maybe over engineering but since it's just been added may as well prove that it works?
Comment #8
darrenwh CreditAttribution: darrenwh as a volunteer and at Investis Digital commentedComment #9
claudiu.cristeaYeah, it makes sense.
Comment #10
claudiu.cristeaAdded deprecation test.
Comment #11
darrenwh CreditAttribution: darrenwh as a volunteer and at Investis Digital commentedCode reviewed and tests run correctly RTBC
Comment #12
catchCommitted 62d7215 and pushed to 8.8.x. Thanks!
Comment #15
quietone CreditAttribution: quietone at PreviousNext commentedpublish the change record