Credits to @dawehner for finding this.

The attached patch (following in comment) shows this using plugin managers. There are some problems, we use constructor injection, so we can't just change a single argument easily (e.g. different cache bin) or add another one. We could change some of the other plugin managers to use setter injection instead, though. And for cache, we could just unify them to use all the same cache bin, possibly introduce a cache.plugin, which could be a cache collector (see #2064511: Use a cache collector to combine related plugin caches)

#2 parent-2118991-2.patch11.76 KBdawehner
PASSED: [[SimpleTest]]: [MySQL] 59,045 pass(es). View
#1 abstract-service-definitions-2118991-1.patch5.2 KBBerdir
PASSED: [[SimpleTest]]: [MySQL] 59,363 pass(es). View
Members fund testing for the Drupal project. Drupal Association Learn more


Berdir’s picture

Status: Active » Needs review
5.2 KB
PASSED: [[SimpleTest]]: [MySQL] 59,363 pass(es). View

Here we go.

dawehner’s picture

11.76 KB
PASSED: [[SimpleTest]]: [MySQL] 59,045 pass(es). View

Here is the approach I went with, so I guess we should leverage the patch from berdir and sort of use the other one for views?

dawehner’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
Issue tags: +DX (Developer Experience)

I do way more like the patch from berdir, RTBC to that one.

tim.plunkett’s picture

Hiding the other patch so it is clearer that Berdir's patch is the RTBC one

Berdir’s picture

There are more examples that could be simplified with this approach, cache bins for example. They only differ in the argument that's passed to the cache factory.

Do we want to get this in as an example and open a follow-up (meta?) issue to use it in other places?

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Wicked. This patch is very nice. Nice that the Symfonic folks already thought of this, and we can just use what they do.

Committed and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

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