Jump to content

Bill in Kansas City

Member
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

0 Neutral
  1. To be completely honest with all present, something I was doing was incorrect. With some help and inspiration from bsmithers I was able to get the log file created to trace program flow, even confirmed that the method I was using before would have worked. I don't know exactly what my mistake was, but it's all on me. Can we just forget this thread ever happend? p.s. Although I should have been able to create PHP errors and never did. I've still got no explanation for that.
  2. CubeCart 6 Debugging: on Caching: off Cloudflare cache: off Browser cache: off Web server: display all errors Since the documentation for writing plug-ins in lacking for anything much beyond "hello world", I've resorted to brute force, line-by-line tracing. I'm working through the visitor stats sample plugin, I'm trying to trace program flow. In every PHP file in the plug-in, I've tried: inserting an echo statement with the filename using echo to insert a script tag to log the filename to the console writing the filename to a log file in a writable folder saving the filename to the $_SESSION None of these efforts did ANYTHING. Just as a test, I inserted what I knew to be syntax errors, invalidated the class, tossed garbage in, NOTHING CHANGES. No logging is done, no errors thrown, the debug section shows no PHP errors, the admin error logs show nothing. I've made enough mischief till kill the cart a dozen times over, what's going on???
  3. Well, it was too good to be true. Changing the datatype may work on the Register page, but on the new customer checkout page it causes the email validation to fail because the success method doesn't understand the response. So we're back to adding the complete method in order to decrement the validation stack. Do the developers have anything to add? Surely I'm not the only person to encounter this issue? Is there a real fix for it?
  4. With more research, I was able to address this issue like so: $.ajax( $.extend( true, { mode: "abort", port: "validate" + element.name, dataType: "text", // << CHANGE THIS VALUE FROM json TO text data: data, context: validator.currentForm, success: function( response ) { ... In this way, the success method is called correctly. (NOTE: the complete method is no longer needed.)
  5. Yes, I mean ver. 1.19. Tried both in Chrome and Firefox, both updated to their latest versions. It is only after the complete method is added that the function works as it should. $.ajax( $.extend( true, { mode: "abort", port: "validate" + element.name, dataType: "json", data: data, context: validator.currentForm, /***** THIS LINE RIGHT HERE ****/ complete: function(response){if(typeof response.responseText != 'undefined'){validator.stopRequest( element, (response.responseText == 'true') )};}, /***** ^^^ THIS LINE RIGHT HERE ^^^^ ****/ success: function( response ) { var valid = response === true || response === "true", errors, message, submitted; validator.settings.messages[ element.name ][ method ] = previous.originalMessage; if ( valid ) { submitted = validator.formSubmitted; validator.resetInternals(); validator.toHide = validator.errorsFor( element ); validator.formSubmitted = submitted; validator.successList.push( element ); validator.invalid[ element.name ] = false; validator.showErrors(); } else { errors = {}; message = response || validator.defaultMessage( element, { method: method, parameters: value } ); errors[ element.name ] = previous.message = message; validator.invalid[ element.name ] = true; validator.showErrors( errors ); } previous.valid = valid; validator.stopRequest( element, valid ); } }, param ) );
  6. Latest download, new install. When filling out the registration form, when clicking the "Register" button (or the "Secure Checkout" button, on page 2 of the checkout process), nothing happens. Nothing at all. In Developer Tools, there's no network activity, no errors or notices in the console. I input $("#registration_form").trigger('submit'); into the console, but the form doesn't submit I just get back a jQuery reference _.fn.init [form#registration_form, context: document, selector: "#registration_form"] which makes me wonder if there's some jQuery override happening on the submit event that sinks the event and returns the form object. I'm so close to done and ready to go live, but this issue has me completely stumped. Please help! EDIT: I tracked the problem down to skins/mySkin/js/vendor/jquery.validate.js, on or about line 108 in this section: if ( validator.form() ) { if ( validator.pendingRequest) { << THIS LINE HERE IS THE PROBLEM validator.formSubmitted = true; return false; } return handle(); } else { validator.focusInvalid(); return false; } validator.pendingRequest is always 1. If I negate that if statement with && false the form submits correctly. Naturally, disabling whatever form validation is going on is not the best course of action, but pendingRequest is set to one and never changed through the validation process. So what gives? EDIT: upgraded jquery.validate.js to version 1.9. Same issue. EDIT: Finally tracked down the issue, it's a problem inside jquery.validate.js. Starting at line 1535 you get $.ajax( $.extend( true, { mode: "abort", port: "validate" + element.name, dataType: "json", data: data, context: validator.currentForm, success: function( response ) { var valid = response === true || response === "true", errors, message, submitted; validator.settings.messages[ element.name ][ method ] = previous.originalMessage; if ( valid ) { submitted = validator.formSubmitted; validator.resetInternals(); validator.toHide = validator.errorsFor( element ); validator.formSubmitted = submitted; validator.successList.push( element ); validator.invalid[ element.name ] = false; validator.showErrors(); } else { errors = {}; message = response || validator.defaultMessage( element, { method: method, parameters: value } ); errors[ element.name ] = previous.message = message; validator.invalid[ element.name ] = true; validator.showErrors( errors ); } previous.valid = valid; validator.stopRequest( element, valid ); // << THIS RIGHT HERE IS WHAT WE NEED TO HAPPEN } }, param ) ); The line "validate.stopRequest" is what should remove the validated elements from the stack, but it doesn't because the success method never fires. The validation is called more than a dozen times, returns a status of [canceled] until the very last time (returning a status of 200), but the success method doesn't fire, ever. It is only by adding this method to the object: complete: function(response){if(typeof response.responseText != 'undefined'){validator.stopRequest( element, (response.responseText == 'true') )};}, the the form will actually submit. I tried replacing the "success" method with "complete", but that doesn't work either. It's only when they are there together that it works. I don't understand.
×
×
  • Create New...