Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DoctrineBundle] Event listener priority is not being respected #6979

Closed
marcospassos opened this Issue Feb 5, 2013 · 6 comments

Comments

Projects
None yet
4 participants
@marcospassos
Copy link

commented Feb 5, 2013

The doctrine event listener priority is not being respected. As you can see, the listeners are being sorted correctly, but the event doctrine.orm.listeners.resolve_target_entity is always executed before the colibri.listener.add_doctrine_inheritance_discriminator.

I'm using the version 2.2.0.

// Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\RegisterEventListenersAndSubscribersPass line 79
Array
(
    [colibri.listener.add_doctrine_inheritance_discriminator] => Array
        (
            [event] => Array
                (
                    [0] => loadClassMetadata
                )
            [priority] => 0
        )
    [doctrine.orm.listeners.resolve_target_entity] => Array
        (
            [event] => Array
                (
                    [0] => loadClassMetadata
                )
        )
)
@marcospassos

This comment has been minimized.

Copy link
Author

commented Feb 7, 2013

The problem is that events added through subscribe are not sorted by priority.

@marcospassos

This comment has been minimized.

Copy link
Author

commented Feb 21, 2013

@vkartaviy just use simple event listeners instead of subscribers.

@stof

This comment has been minimized.

Copy link
Member

commented Feb 21, 2013

@marcospassos subscribers are also sorted together. but not with listener

@marcospassos

This comment has been minimized.

Copy link
Author

commented Feb 21, 2013

@stof Exactly, but it causes some problems, as you can see. IMO, listeners should be sorted independent of way it was registered.

@robfrawley

This comment has been minimized.

Copy link
Contributor

commented Apr 8, 2015

Is this still the case with 2.4/5?

@superdav42

This comment has been minimized.

Copy link
Contributor

commented Sep 27, 2016

As far as I can tell this is still a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.