[REF] Remove usage of deprecated jqXHR.error in jQuery code #21919
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
jqXHR.error
is deprecated in jQuery 1.8 and removed in jQuery 3.This update replaces usage of jqXHR.error with the correct
jqXHR.fail
. (jqXHR
refers to the promise interface returned by calls to$.ajax()
and$.post()
)Before
CiviCRM was using deprecated jQuery methods, which have been removed from jQuery 3.
After
CiviCRM is no longer using the deprecated
jqXHR.error
method.Comments
See https://api.jquery.com/jQuery.ajax/#jqXHR for details of the deprecation. CiviCRM appears to currently be using jQuery 1.12.4 which will support the
jqXHR.fail
method.Although CiviCRM does not use the host CMS's version of jQuery by default, extensions like https://civicrm.org/extensions/civi-jquery do allow CiviCRM to work in this way. This change will help avoid problems if sites attempt to run CiviCRM with their host CMS' version of jQuery and the host CMS is using jQuery 3.
Longer-term this will be a step towards making it feasable for CiviCRM to upgrade to jQuery 3.