Problem/Motivation
I have hit this bug in my pretty special use case.
The module I'm working on has two tagged services, the first one has been working well for a while but the second is a work in progress, however when testing something else I hit the following error PHP Fatal error: Uncaught Error: Call to a member function getName() on string in /core/lib/Drupal/Core/DependencyInjection/Compiler/TaggedHandlersPass.php:116
After doing some digging in \Drupal\Core\DependencyInjection\Compiler\TaggedHandlersPass::process
I found that I should really be hitting the LogicException on line 110, but I wasn't because $interface was already set from the previous pass of the loop.
Proposed resolution
Set $interface to Null.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#6 | 2852515-6.patch | 2.3 KB | dawehner |
#6 | 2852515-6-test.patch | 1.46 KB | dawehner |
#2 | 2852515-2.patch | 866 bytes | timmillwood |
Comments
Comment #2
timmillwoodWith the attached patch I am now hitting
Symfony\Component\DependencyInjection\Exception\LogicException: Service consumer 'workspace.replication_manager' class method Drupal\workspace\Replication\ReplicationManager::addReplicator() has to type-hint an interface. in /core/lib/Drupal/Core/DependencyInjection/Compiler/TaggedHandlersPass.php:111
which is correct.Comment #3
dawehnerNice find!
Is this something we can test?
Comment #4
timmillwoodMaybe, but I'm not sure if it's more work than it's worth.
Comment #5
dawehnerWell, we have a unit test already. I totally believe we can add support for more.
Comment #6
dawehnerComment #8
timmillwoodThanks for writing the test @dawehner!
Comment #9
xjmComment #12
xjmOopsie. Thanks! Committed to 8.4.x and cherry-picked to 8.3.x.