Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Notice: Array to string conversion instead of informative error message when configuration with non-existent Doctrine connection is found in RegisterEventListenersAndSubscribersPass #27811

Copy link
Copy link
Closed
@kalifg

Description

@kalifg
Issue body actions

Symfony version(s) affected: 3.4.11

Description
There is a small bug in an exception thrown by RegisterEventListenersAndSubscribersPass when a Doctrine connection that doesn't exist is referenced in configuration. Instead of getting the helpful exception message:

The Doctrine connection "root" referenced in service "stof_doctrine_extensions.listener.sluggable" does not exist. Available connections names: default

You instead get

Notice: Array to string conversion

How to reproduce
I was able to reproduce this by having the following configuration:

stof_doctrine_extensions:
    orm:
        root:
            sluggable: true
            timestampable: true

after I removed the connection named root.

Possible Solution
The variable $taggedSubscriber here is actually an array, with the name of the service as the first member. Changing the reference to $taggedSubscriber[0] should fix this.

https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php#L72

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.