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

Duplicate checkout_controller_success_action Observer Name in cards vs banks #96

Open
mattangebert opened this issue Feb 9, 2023 · 1 comment

Comments

@mattangebert
Copy link

You are using the same observer name for the AfterPlaceOrder Observer in events.xml inside the 2 modules
openpay-magento2-cards and openpay-banks

which can and will cause overrides as mentioned by magento
https://developer.adobe.com/commerce/php/development/components/events-and-observers/#subscribing-to-events
Quote:
The observer name must be unique, or an override will occur.

Code from openpay-banks:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="checkout_onepage_controller_success_action">
        <observer name="checkout_controller_success_action" instance="Openpay\Banks\Observer\AfterPlaceOrder"  />
    </event>
</config>

Code from openpay-magento2-cards

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="checkout_onepage_controller_success_action">
        <observer name="checkout_controller_success_action" instance="Openpay\Cards\Observer\AfterPlaceOrder"  />
    </event>
</config>

As fare as i could see you are not using the name anywhere so it an be easily fixed by renaming them e.g
banks_checkout_controller_success_action & cards_checkout_controller_success_action

@FrancescoTerreni
Copy link

Any update? 🍡

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants