EventHandler priority

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Locked
User avatar
redwarp
Forum Members
Forum Members
Posts: 37
Joined: Wed Mar 24, 2010 5:36 pm

EventHandler priority

Post by redwarp »

Hello !
I'm crafting module that somewhat change CMS behavior, sometime redirecting people places after an event is triggered.

Let's say that I have two modules.
  • One keeps tracks off the LoginPost event, and record it
  • The other one redirect the user after a LoginPost event.
In the event handler list, if the second module has priority, I'm facing a serious problem : because of redirection, the first module event handler function might never be called by CMS.
Is there a way to "force" a module to be at the bottom of the chain of event handler ?

Thanks in advance.

--
Redwarp
Salketer

Re: EventHandler priority

Post by Salketer »

I am not sure if there is a way to prioritize event handlers, I haven't done a lot of event handling. My work-around would be to create an event after the login is tracked and use that event for your second module.

Try that if you are in a hurry. If you can wait, then you might get a better way to do it from more experienced members.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: EventHandler priority

Post by calguy1000 »

a) Events are one way only... you cannot return a result to stop processing etc.
b) Events weren't really designed for display level things. more for behind the scene things that
    need to happen.
c) things like redirection etc. can easily be done in templates, which are display level things.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Locked

Return to “Developers Discussion”