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.
Problem/Motivation
Follow-up to #1973618: DIC: Lazy instantiation of service dependencies (ProxyManager for "proxy services"). The generated proxy code breaks DrupalKernelTest
, but only when the test is run from the GUI. The generated proxy classes conflict with the ones in the test container loaded from the disk.
Proposed resolution
Remaining tasks
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#6 | 2409247-namespaced-container-5.diff | 3.25 KB | znerol |
Comments
Comment #1
dawehnerSo we talk about the problem of using multiple different include_once statements for different compiled containers? PUH
Comment #2
dawehnerWell, the simplest idea would be to wrap the
class_exists()
Comment #3
znerol CreditAttribution: znerol commentedI've traced down the problem to the following difference between the CLI test runner and the GUI: The former does not dump its container, while the latter does.
I believe the following happens in the GUI:
service_container_prod
including a couple of generated proxy classes)service_container_testing
including a couple of generated proxy classes. However the proxies have the same names as the ones loaded before by the test runner.Comment #4
znerol CreditAttribution: znerol commentedHow about just use a environment based namespace for the dumped container?
Comment #5
znerol CreditAttribution: znerol commentedAdding tests. The test-only patch is also the interdiff.
Comment #6
znerol CreditAttribution: znerol commentedComment #8
jibran+1 from me this looks good.
Comment #9
dawehnerGreat fix!
Comment #10
alexpottThis issue addresses a major bug and is allowed per https://www.drupal.org/core/beta-changes. Committed 722c8dd and pushed to 8.0.x. Thanks!