You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Events are not currently emitted by craft\commerce\base\Gateway or craft\commerce\services\Gateways when saving a Gateway’s configuration.
Craft typically emits events from the service class when saving Project Config-bound changes (beforeSave when modifying values, then afterSave in a PC event handler). The model events appear to be less consistently triggered…
Steps to reproduce
Add a listener in a custom module:
use craft\events\ModelEvent;
use craft\commerce\base\Gateway;
use yii\base\Event;
Event::on(
Gateway::class,
Gateway::EVENT_BEFORE_SAVE,
function(craft\events\ModelEvent$event) {
Craft::dd('Got it!');
}
);
Save a new or existing gateway
Expected behavior
Using the example code, the page is halted.
I should also be able to listen to events from the service class, i.e. craft\commerce\services\Gateways::EVENT_BEFORE_SAVE_GATEWAY.
What happened?
Description
Events are not currently emitted by
craft\commerce\base\Gateway
orcraft\commerce\services\Gateways
when saving a Gateway’s configuration.Craft typically emits events from the service class when saving Project Config-bound changes (
beforeSave
when modifying values, thenafterSave
in a PC event handler). The model events appear to be less consistently triggered…Steps to reproduce
Expected behavior
craft\commerce\services\Gateways::EVENT_BEFORE_SAVE_GATEWAY
.Actual behavior
No event is triggered.
Originally reported on Discord!
The text was updated successfully, but these errors were encountered: