` public function myFunction($entry, $values) {
var_dump($values);
die();
} `
I’m building an extension which triggers on entry insert or update. I couldn’t get the extension to trigger on update so I stripped my code back to the above. $values is dumped on insert but not update.
Am I missing something or is this a bug?
I don’t know the exact reason why update action is not working in the hook “after_channel_entry_save” for you.
But, there are also providing the two different hooks for the insert and update channel data.
So in your case, you can use the “after_channel_entry_update” hook to get event of update the channel data.
Documentation Link: https://docs.expressionengine.com/latest/development/extension-hooks/model/channel-entry.html
Let me know if you still any issue.
I think that “Low Search” uses the “after_channel_entry_save” so you can run below query in database to find which add-ons used this hook.
SELECT * FROM exp_extensions
WHERE hook
LIKE ‘after_channel_entry_save’ ORDER BY extension_id
DESC
If you will find the “after_channel_entry_save” hook in the table for other add-ons then you can update the value from “y” to “n” for the “enabled” field for that records of the add-ons for debugging.
Then, You need to verify to check your function of that hook will be work! If it is works then we can sure the issue is created due to the code of the other add-ons.
Notes: After update above query, you have to again update the value from “n” to “y” for “enabled” field for other add-ons to run the hook for that add-ons.
Let me know if you have any issue.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.