8000 minor #27813 [Doctrine Bridge] Fixed usage of wrong variable when tag… · symfony/symfony@7f3aae0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7f3aae0

Browse files
committed
minor #27813 [Doctrine Bridge] Fixed usage of wrong variable when tagged subscriber is invalid (stloyd)
This PR was merged into the 2.8 branch. Discussion ---------- [Doctrine Bridge] Fixed usage of wrong variable when tagged subscriber is invalid | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #27811 | License | MIT This change prevents error when invalid subscriber is being used. Expected result: ``` The Doctrine connection "root" referenced in service "stof_doctrine_extensions.listener.sluggable" does not exist. Available connections names: default ``` Actual error: ``` Notice: Array to string conversion ``` Commits ------- cf1bc66 [Doctrine Bridge] Fixed usage of wrong variable when tagged subscriber is invalid
2 parents ae0a69a + cf1bc66 commit 7f3aae0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ private function addTaggedSubscribers(ContainerBuilder $container)
7575
$connections = isset($tag['connection']) ? array($tag['connection']) : array_keys($this->connections);
7676
foreach ($connections as $con) {
7777
if (!isset($this->connections[$con])) {
78-
throw new RuntimeException(sprintf('The Doctrine connection "%s" referenced in service "%s" does not exist. Available connections names: %s', $con, $taggedSubscriber, implode(', ', array_keys($this->connections))));
78+
throw new RuntimeException(sprintf('The Doctrine connection "%s" referenced in service "%s" does not exist. Available connections names: %s', $con, $id, implode(', ', array_keys($this->connections))));
7979
}
8080

8181
$this->getEventManagerDef($container, $con)->addMethodCall('addEventSubscriber', array(new Reference($id)));

0 commit comments

Comments
 (0)
0