Every time on save (creating or editing) a product or a service, a confirmation (onbeforeunload) is required.
Anyway, if "leave this page" choosen, save runs correctly.
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
I tried reproducing the issue in v6.5.0, but its working fine for me. This issue is related to javascript. Try installing firebug in your Mozilla browser and try the same operation. It might helps you to catch the error.
...// If the form doesn't validate, clear the 'validating' class before the user has a chance to submit againsetTimeout(function(){ element.removeClass('validating');}, 100);...
set setTimeout 2nd parameter to 300 (or more) and try again.
The issue raises in these Vtiger points:
Accounts: create or modify (on modify you have to change something before click Save button)
Products: create or modify (on modify you have to change something before click Save button)
Services: create or modify (on modify you have to change something before click Save button)
OK now sit down and relax because I'll try to put steps here :D
Everyone of up above actions exec an Ajax post:
Account to check duplicate,
Products and Services for multiple currencies and
Users to check if new user already exist
Vtiger JS code is correct, but setTimeout into jquery.validationEngine.js might raises this issue if form validation is with AppConnector.request
I start from bottom and I expose for Account module: about the others it is similar
Pop up dialog is showed because into (layouts/vlayout/modules/Vtiger/resources/Edit.js)
Why is it undefined?
Submit occours two times: first one by Save button click and the second one by javascript after Ajax post done
On every submit following js code is executed
...registerSubmitEvent: function() { var editViewForm = this.getForm(); editViewForm.submit(function(e){ //Form should submit only once for multiple clicks also if(typeof editViewForm.data('submit') != "undefined") { return false; } else { var module = jQuery(e.currentTarget).find('[name="module"]').val(); if(editViewForm.validationEngine('validate')) { //Once the form is submiting add data attribute to that form element editViewForm.data('submit', 'true'); //on submit form trigger the recordPreSave event var recordPreSaveEvent = jQuery.Event(Vtiger_Edit_Js.recordPreSave); editViewForm.trigger(recordPreSaveEvent, {'value' : 'edit'}); if(recordPreSaveEvent.isDefaultPrevented()) { //If duplicate record validation fails, form should submit again editViewForm.removeData('submit'); e.preventDefault(); } } else { //If validation fails, form should submit again editViewForm.removeData('submit'); // to avoid hiding of error message under the fixed nav bar app.formAlignmentAfterValidation(editViewForm); } } });},...
on first submit:
editViewForm.validationEngine('validate') is true, so it adds data: editViewForm.data('submit', 'true') => correct
recordPreSaveEvent.isDefaultPrevented() is true because Ajax post, so it removes data: editViewForm.removeData('submit') => correct
Ajax post is running and as soon as it is done, it execs second submit
I think yes.
Oleg Tsoy into his issue #125 (closed) discovered problem before me, but fix resolves effect not the source problem
"double press Save button" was until 6.4.0 and that was into Account, Products, Services and Users (creating)
into vt6.4.0, try to set setTimeout 2nd parameter to 10 (into libraries/jquery/posabsolute-jQuery-Validation-Engine/js/jquery.validationEngine.js) and everything will work fine
"double press Save button" problem had been hidden "pop up dialog" problem
first click ran Ajax post and second click ran Save