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

Get channelEntry data inside a post_save

Developer Preview

Reinos's avatar
Reinos
79 posts
7 years ago
Reinos's avatar Reinos

Hi there,

It looks like the post_save method of the fieldtype is not getting called after saved. I need the categories of that particular entry and get it with

ee('Model')->get('ChannelEntry')->filter('entry_id', $this->content_id())->first()->Categories->toArray()

but that seems not updated when i change the categories. I did not test it on other field, because i just need the categories. So perhaps there is a better way to get the entry data inside a fieldtype save() or post_save() method.

Best, Rein

       
Kevin Cupp's avatar
Kevin Cupp
791 posts
7 years ago
Kevin Cupp's avatar Kevin Cupp

You should find that post_save() is called when your field changes. If your field contents didn’t change, then currently it does not get called. Do you need to grab these categories here or could you use an extension hook?

       

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.