I’ve had some requests for a couple of my EE2 add-ons be ported to EE3, but am having some issues since, I think, some hooks behave differently now. For example, Securit:ee relied heavily on a LOT of hooks that don’t appear to exist any longer. Any chance I can get a cheat sheet on how best to reconcile?
Export It
Extension Hooks
cp_menu_array (Just adds menu to CP)
Securit:ee
Extension Hooks
sessions_start (IP Locker)
Has to check the member_id and member_group for access to front/back end of site based on IP
cp_member_login (CP Quick Deny)
Has to check the member_id and member_group for access to backend of site based on member_group and/or member_id
cp_member_login (CP Login Alert)
Sends an email when someone logs into the backend
cp_members_member_delete_end (Forgot Password)
Just used to remove any temp data that may be stored during the Forgot Password flow (hashes and the like)
sessions_end (Password Expire)
This one’s tricky and where a real problem lies. If the CP is configured to require a session ID in URLs, then this hook can’t access the value since it doesn’t exist at the time this hook is called now.
cp_members_member_create (Member Registration Nofication)
Just sends a custom registration email on account creation in the CP
sessions_end (Member Expire)
Has to dispaly an error page if a member account is expired
Entry Analytics
Extension Hooks cp_menu_array (Injection of the CP JavaScript for entry stats widget)
channel_entries_query_result (injection into tempalte tags)
post_controller (REALLY important to handle the override on debug output)
Any ideas?
Are you sure you’ve checked the latest docs? For example, sessions_end and sessions_start both exist in EE3 as shown in the Session Library Extension Hooks
So, you’re saying that if I call the sessions_end hook on a CP request, I’ll have access to the value for session_id that’s expected in the query string security checks, like it used to in EE <= 2.8 (or whenever it changed)?
Is that what you’re saying? Because, the variable being defined in that file isn’t the same as being defined AND having a value that passes the security, you know?
cp_menu_array
:
Have you checked out the new menu hook in the 3.4.0 developer preview?
sessions_start
, sessions_end
:
These haven’t changed, per se. They have always been a bit unusual in that they occur in the class’s constructor, so they are executed while PHP is still instantiating the object. So session
won’t be on the facade since it technically doesn’t exist yet. But we’ve always passed the session object as a parameter and recommended its use—are you taking advantage of that? If so, please share what isn’t working.
cp_member_login
, cp_members_member_delete_end
, cp_members_member_create
, channel_entries_query_result
:
None of these hooks changed to my knowledge. If you’re having issues, please share your code and let us know what isn’t working as expected.
post_controller
:
This was a CodeIgniter system-level “hook” and not an ExpressionEngine extension hook. We removed them entirely in v3 as it’s confusing to have separate entrance points for extending the system, and CI’s hooks were not supported anyway as they are not installable or manageable without manual manipulation on the part of the end user.
Let us know what you’re wanting to do, perhaps even requesting a specific extension hook (and identifying the location in the code) that you’d like to see, and we can see if we can accommodate that with a new properly supported hook.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.