We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

after_channel_entry_save hook error

Development and Programming

PhilHazell's avatar
PhilHazell
4 posts
5 years ago
PhilHazell's avatar PhilHazell

` 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?

       
Tom Jaeger's avatar
Tom Jaeger
228 posts
5 years ago
Tom Jaeger's avatar Tom Jaeger

What version of EE are your currently running? Any other add-ons in use on the site? Also, are there any other extensions using this hook?

       
PhilHazell's avatar
PhilHazell
4 posts
5 years ago
PhilHazell's avatar PhilHazell

We’re running 5.3.0.

Other Add-ons:

DataGrab, CE Image, Low Search, Streeng

There are no other extensions that I’m aware of that use this hook.

       
PhilHazell's avatar
PhilHazell
4 posts
about 5 years ago
PhilHazell's avatar PhilHazell

Is there any update on this? Would like to iron out the issue with this hook

       
's avatar
2 posts
4 years ago
's avatar

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.

  1. after_channel_entry_insert: Called after the channel entry object is inserted.
  2. after_channel_entry_update: Called after the channel entry object is updated.

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.

       
's avatar
2 posts
4 years ago
's avatar

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.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.