[Vtigercrm-developers] Chrome "double" posting...

Alan Lord alanslists at gmail.com
Wed Jul 4 15:56:14 GMT 2018


Bug filed and subsequently now closed.

Thanks to Prasad for tracing the cause of the problem:

For this customer's system, I have some custom validation routines that 
need Ajax (check vtiger_pbxlookup table for duplicate phone number 
etc...) which were quite hard to port to v7 - I had to intercept the 
recordPresaveEvent and then continue or not based on the results.

It works for a "normal" EditView save in all browsers I tested. But when 
using Chrome (or any browser using the same engine, i.e. Safari, Opera) 
and when the the Edit is an overlay (i.e. using Add related record) it 
did something unexpected.

I traced the error to one small bit of javaascript

             if(!multiFields.length) {
                 thisInstance.postValidated = true;
                 form.submit();
             }

The above works fine in Firefox but in Chrome the code execution 
continues after the form.submit(); which is not what I intended to 
happen ;-)

So all I needed to do was to add a return;

             if(!multiFields.length) {
                 thisInstance.postValidated = true;
                 form.submit();
                 return;
             }

Maybe this might help others at some point.

Cheers

Al


On 04/07/18 10:18, Prasad wrote:
> Alan,
> 
> Please file issue on tracker and share access to review the mystery.
> 





More information about the vtigercrm-developers mailing list