qcubed/framework — pull request #180 by spekary (2013-03-13 23:57:56+00:00)
Title: Fixing ajax queue to not queue the formstate, in case it changes

This fix will help with many random formstate problems, including situations where you get messages that the session has been lost, even though it hasn't, or that you are trying to cast an empty object to a form. This is especially problematic when popping up multiple windows that each have QCubed forms, as the formstates will no longer correspond to even the form object types, causing the dreaded "Trying to cast PHP_Empty_Object to Form.." problem.

The problem shows up primarily when one action triggers multiple events, and the first event changes something in the formstate. The 2nd event will squash the formstate because it had saved it previously, and then you will eventually get an error since the formstate is no longer valid.

I tested this fix with QFormStateHandler and QSessionStateHandler, and seems to work well.