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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

claudiu.cristea created an issue. See original summary.

claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Status: Active » Needs review
FileSize
1.1 KB

Patch.

claudiu.cristea’s picture

Status: Needs review » Needs work

The last submitted patch, 3: 3061117-3.patch, failed testing. View results

claudiu.cristea’s picture

Status: Needs work » Needs review
Issue tags: +D8 cacheability
FileSize
1.64 KB
2.75 KB

Remove the usage of deprecated parameter from tests.

darrenwh’s picture

I 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?

darrenwh’s picture

Status: Needs review » Needs work
claudiu.cristea’s picture

Issue tags: +Needs tests

Yeah, it makes sense.

claudiu.cristea’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
FileSize
3.44 KB
1.05 KB

Added deprecation test.

darrenwh’s picture

Status: Needs review » Reviewed & tested by the community

Code reviewed and tests run correctly RTBC

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 62d7215 and pushed to 8.8.x. Thanks!

  • catch committed 62d7215 on 8.8.x
    Issue #3061117 by claudiu.cristea, darrenwh: Make optional and deprecate...

Status: Fixed » Closed (fixed)

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

quietone’s picture

publish the change record