postSubmit event not always raised in Editor 1.6.3
postSubmit event not always raised in Editor 1.6.3
One of the release notes for Editor 1.6.3 states the following:
postSubmit could be triggered with incorrect parameters when an error state was returned from the server in response to the Editor Ajax request.
By looking at the diff between 1.6.2 and 1.6.3, I found that all calls to _event( 'postSubmit', ...)
have been removed from Editor.prototype._submitSuccess
and Editor.prototype._submitError
. Instead, the event is raised inside Editor.prototype._ajax
.
Unless I'm missing something, that means the event is not always raised by Editor 1.6.3 because the _ajax
method is not always used. For example: stand-alone tables probably don't use this code path.
// Submit to the server (or whatever method is defined in the settings)
var submitWire = this.s.ajax || this.s.ajaxUrl ?
this._ajax :
this._submitTable;
Replies
You aren't missing anything. I did.
Thanks for pointing that out, I'll have it fixed soon.
Allan
I'm also encountering this issue. As the reporter of the initial issue that prompted this change I am running into this issue after upgrading to Editor 1.6.3. By using a custom function for the ajax setting I now don't see the
postSubmit
event.Thanks for the report! I'll post back in this thread with the fix and update.
Allan
Similar issue here. The application crashes on a simple SQL dup key when I use "postSubmit"
The event is being triggered but the json object is a null value!
This is my post submit statement which doesn't work any more:
For the sake of completeness: If there is no SQL error the event is also triggered and the JSON object is not null. So something is wrong with Editor's error handling I guess.
Its taken longer than I had hoped to dig into and resolve this - my apologies.
I've committed the fit locally and I will release a bug fix version of Editor with this change (and other fixes) next week.
Regards,
Allan
Thanks.
FYI the company where I use DataTables and Editor has decided not to renew my contract. I will not be able to test fixes released after the first week of August.