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

publish_form_channel_preferences and publish_form_entry_data hooks

Developer Preview

Brian Litzinger's avatar
Brian Litzinger
693 posts
9 years ago
Brian Litzinger's avatar Brian Litzinger

I mentioned this in Slack a few days ago, just posting it here so it doesn’t get lost.

The publish_form_channel_preferences hook doesn’t seem to be a thing in EE3 anymore. As far as I can tell its the only hook that could be called on the publish/create or publish/edit page aside from sessions_end in EE2 aside from whatever hooks are called for fieldtypes. In EE3 right now, from what I can tell, its difficult to do something just on the publish/create and publish/edit pages and no where else. publish/edit has the publish_form_entry_data hook to work with, but no such thing exists for publish/create.

Using session_end isn’t viable because ee()->session isn’t set for some reason so other services that may need to be called on the publish/create and publish/edit pages that rely on session data can’t be used.

In EE2 the publish_form_entry_data hook is called when creating and editing an entry. In EE3 its only called when editing.

The publish_form_channel_preferences hook used to be another way to do specific things on create and edit pages without doing hacking things in sessions_end, but since its not a thing anymore we’re left with no viable option to do non-fieldtype related things on the publish pages.

       
Pascal Kriete's avatar
Pascal Kriete
2,589 posts
9 years ago
Pascal Kriete's avatar Pascal Kriete

Can you explain a bit more what you’re doing in this hook?

General consensus among our team is that we can’t come up with a reason to modify entry data on create, since it’s completely blank. It sounds like you might just need a different hook.

       
Brian Litzinger's avatar
Brian Litzinger
693 posts
9 years ago
Brian Litzinger's avatar Brian Litzinger

I was using these hooks to add a toolbar to the publish page for Publisher. I can add the toolbar html to the page with cp_js_end (kind of a janky way to do it, but it works), but there is a whole slew of other things I need to do, e.g. check the user’s permissions, check the entry data when editing to see what the toolbar should be doing, which I can’t do with cp_js_end. publish_form_channel_preferences was a good place to do this in EE2 b/c it was called on the create and edit entry pages, but its not called at all in EE3. I used publish_form_channel_preferences kind of like a session_end hook just for the publish/create and publish/edit pages.

       

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.