Skip to content

events.xml event with exclude param #1684

Closed
@michsk

Description

@michsk

I would like to hook on the event core_collection_abstract_load_before. But in my observer i would like to inject the \Magento\Backend\Model\Auth, so i can get the logged in admin. This gives problems because Somewhere in the injecting process of Auth, we try to inject the StoreManager which itself again tries to load a collection of stores. This breaks the whole process and means i will have to manually define all the events that use load_before, but than with the event_prefix.

Defining an except in the <event> tag would result in less work. We could even make it accept a list?

    <event name="core_collection_abstract_load_before" exclude="store_collection_load_before">
        <observer name="foo_bar_event_prefixed_collection_load_before" instance="Foo\Bar\Model\Observer" method="coreCollectionLoadBefore" />
    </event>

Or is maybe something already possible?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: Format is not validGate 1 Failed. Automatic verification of issue format is failed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions