Luis Majano Forums Notification: Post to Problems when incorrect handler specified on a form post and link

Title: RE: Problems when incorrect handler specified on a form post and link
Thread: Problems when incorrect handler specified on a form post and link
Forum: Bugs (ColdBox)
Conference: ColdBox
User: lmajano

Hi puc,

I have been revising the code and the following occurs in order.

1)
Event is detected
2) Handler is retrieved and checked internally:
  a) Handler
is Invalid:
     1) is onInvalidEvent setting?
        a) Yes: is onInvalidEvent
same as incoming event (This is to check for loops)
            1) Yes: Throw
error
        b) No: onInvalidEvent is valid, log the invalid event in the AOP
logging facility, then override the event with the onInvalidEvent
      2)
onInvalidEvent setting does not exist, then throw an exception: Handler does not
exist.
  b) Handler is Valid.
3) Does Method exist or valid?
   a) No - method
is invalid:
      1) AOP logging of invalid event
      2) Does onInvalidEvent
setting exist:
         a) TRUE: Relocate to it.
         b) FALSE: Throw
exception, invalid event
   b) Yes - method is valid, continue execution.

As
you can see from the pseudo-code, the only relocation occurs when there is an
invalid event in a valid handler and the onInvalidEvent setting is declared. The
only place where I can see a loop occurring is if the event declaration in the
onInvalidEvent is wrong.

I just reproduced it. This occurs when the event
portion of the onInvalidEvent setting is also invalid. This will throw the
relocations to a loop. I am just making the fixes and will post in the SVN. This
will be ready for production.

The exception's wiki has been updated:
http://ortus.svnrepository.com/coldbox/trac.cgi/wiki/cbExceptionsList

And the
appropriate ticket:
http://ortus.svnrepository.com/coldbox/trac.cgi/ticket/126#preview

http://www.luismajano.com/forums/index.cfm?event=ehMessages.dspMessages&threadid=E64467E8-123F-6116-42984C08161481FA