Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use valid jQuery3 methods on ajax calls #4541

Closed

Conversation

cpfergus1
Copy link
Contributor

@cpfergus1 cpfergus1 commented Sep 2, 2022

Summary

After the inclusion of #4167, it was discovered that some of the extensions (specifically solidus_product_assembly) specs are failing on master with no changes to the code. It was discovered that after moving to jQuery3, some methods no longer existed including one being utilized in ajax calls for splitting shipments and image uploads.

This PR corrects these issues by updating the deprecated methods to utilize those available in jQuery3.
TODO: Build a test to cover this script.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

  • I have written a thorough PR description.
  • I have kept my commits small and atomic.
  • I have used clear, explanatory commit messages.

The following are not always needed (cross them out if they are not):

  • I have added automated tests to cover my changes.
  • I have attached screenshots to demo visual changes.
  • I have opened a PR to update the guides.
  • I have updated the readme to account for my changes.

From the jQuery upgrade guide:
```
The jqXHR object returned from jQuery.ajax() is a jQuery Deferred and has historically had three extra methods with names matching the arguments object of success, error, and complete. This often confused people who did not realize that the returned object should be treated like a Deferred. As of jQuery 3.0 these methods have been removed. As replacements, use the Deferred standard methods of done, fail, and always, or use the new then and catch methods for Promises/A+ compliance.

Note that this does not have any impact at all on the ajax callbacks of the same name passed through the options object, which continue to exist and are not deprecated. This only affects the jqXHR methods.
```
@github-actions github-actions bot added the changelog:solidus_backend Changes to the solidus_backend gem label Sep 2, 2022
@cpfergus1 cpfergus1 changed the title Nebulab/fix jquery methods Use valid jQuery3 methods on ajax calls Sep 2, 2022
@cpfergus1 cpfergus1 closed this Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_backend Changes to the solidus_backend gem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant