Page 1 of 1

EventHandler priority

Posted: Thu Jul 01, 2010 1:22 pm
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

Re: EventHandler priority

Posted: Fri Jul 02, 2010 3:53 pm
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.

Re: EventHandler priority

Posted: Fri Jul 02, 2010 4:51 pm
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.