Questions tagged [events]

The tag has no usage guidance.

12 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
785 views

How to handle Craft 3 events in a plugin? Element API is returning null data

The below refers to Craft 3 and the Element API plugin for Craft 3. I would like to do something when the Element API plugin fires its onBeforeSendData event, I can see in the controller for element ...
2
votes
0answers
24 views

What are the replacements for the order events onBeforeAddToCart and onBeforeGatewayRequestSend in Commerce 2

I'm looking for replacements for the events onBeforeAddToCart and onBeforeGatewayRequestSend. I used onBeforeAddToCart to prevent the user from adding an article from different article groups to the ...
2
votes
0answers
78 views

Timezone drama for events calendar

Working on site where there is events calendar of conferences and webinars. Users are (literally) all over the world. Trying to figure out how I am going to handle time zones. Factors: - Fields I am ...
1
vote
0answers
71 views

User Event before Login - check if user has password and logged in before

Is there a User Event before the authentication is fired? I want to show a message if the user doesn't have a password yet and if it's his first login / check if he never logged in before - All in ...
1
vote
0answers
72 views

Can't set structured entry parentId in BEFORE_SAVE event using field data

I have created an event that is called on beforeSave within my plugin. Code below: Event::on( Entry::class, Entry::EVENT_BEFORE_SAVE, function(ModelEvent $event){ /...
1
vote
0answers
154 views

commerce_orders onOrderComplete not triggered?

Problem: I want to trigger an action (Instant Analytics plugin) whenever a payment (Craft Commerce plugin) is successful (webhook). Payment provider is Mollie. So far I created a plugin that listens ...
1
vote
0answers
169 views

Plugin event listener not firing

In my plugin I have an init() method: public function init () { parent::init(); require CRAFT_PLUGINS_PATH.'/myplugin/vendor/autoload.php'; $this->callTemplateHooks(); craft()-&...
1
vote
0answers
121 views

Detaching onSaveEntry events from craft()->entries->saveEntry($entry)?

I have a plugin that does a bunch of stuff with external APIs onSaveEntry and then saves some of the gathered information back into the entry. I currently use craft()->entries->saveEntry($entry);...
0
votes
0answers
21 views

How how can I restrict/fail a login using a User::EVENT_BEFORE_AUTHENTICATE hook?

When a user attempts to login, I check a 3rd-party to make sure they should have access. If they shouldn't, I need to stop them logging in. I have this working, but I could only get it working by ...
0
votes
0answers
25 views

How to differentiate EVENT_BEFORE_UPDATE_SUBSCRIPTION events in Commerce 2/3

I'm listening for various subscription events to send emails to members. Right now, I'm dealing with subscriptions where a renewal payment fails. I'm specifically listening for ...
0
votes
0answers
14 views

trigger javascript when block is added to matrix or supertable

I need to run javascript to modify a field-input when the user edits an entry and adds a block/row to a matrix or super-table field. Is there an event to listen on or some callback to hook in? ...
0
votes
0answers
156 views

How to exclude some fields from the searchindex using the RegisterElementSearchableAttributesEvent event?

Context I had big issues on a Craft 2 multilingual site with dozens of thousands of entries that were using Matrix fields. The site had become extremely slow (almost unusable), especially when ...