Bug Tracker

Ticket #4825 (closed bug: fixed)

Opened 5 years ago

Last modified 17 months ago

Data returned from ajaxSetup dataFilter is not passed to ajax complete() callbacks

Reported by: jbabbitt Owned by:
Priority: low Milestone:
Component: ajax Version: 1.4.4
Keywords: Cc: jaubourg
Blocking: Blocked by:

Description

The ajax complete() callbacks are passed xhr, but not the data returned from dataFilter.

As a result, dataFilter will not be applied to data loaded via the .load() function.

Change History

comment:1 Changed 4 years ago by dmethvin

  • Milestone changed from 1.3.2 to 1.4.3

comment:2 Changed 4 years ago by dmethvin

  • Status changed from new to open

One solution would be to add settings (s) as an argument to the call to the complete handler in handleComplete.

comment:3 Changed 4 years ago by snover

  • Milestone 1.4.3 deleted

Resetting milestone to future.

comment:4 Changed 4 years ago by rwaldron

  • Keywords ajaxSetup,dataFilter,ajaxrewrite added; ajaxSetup dataFilter removed

comment:5 Changed 4 years ago by jaubourg

  • Status changed from open to closed
  • Resolution set to fixed

comment:7 Changed 4 years ago by jitter

  • Keywords ajaxSetup,dataFilter added; ajaxSetup,dataFilter,ajaxrewrite removed
  • Priority changed from minor to low
  • Version changed from 1.3.2 to 1.4.4
  • Milestone set to 1.5

comment:8 Changed 17 months ago by james.m.greene@…

This bug was never fixed. Or, it may have been fixed only for load but not for Ajax calls at large.

Fiddle:  http://jsfiddle.net/JamesMGreene/CUJrN/

comment:9 Changed 17 months ago by JamesMGreene

Requesting that this bug be reopened.

comment:10 Changed 17 months ago by dmethvin

  • Cc jaubourg added
  • Keywords ajaxSetup,dataFilter removed
  • Status changed from closed to reopened
  • Resolution fixed deleted
  • Milestone 1.5 deleted

@jaubourg can you take a look?

comment:11 Changed 17 months ago by dmethvin

  • Status changed from reopened to open

In general it's better to create a new ticket than reopen an ancient bug. We need a Trac feature that freezes tickets more than a year old and prevents posts on them.

comment:12 Changed 17 months ago by jaubourg

  • Status changed from open to closed
  • Resolution set to fixed

You should create a new ticket. Behaviour is consistent with what is documented. Your request is unrelated to ajaxSetup or the actual use-case involved here (title is still very misleading, original request was about applying dataFilter in ajaxSetting in the context of load as was determined with OP iirc).

It is obvious you wish the third parameter to be the success value. It is a feature request and should be in its own ticket for proper discussion. My take on it is that there are enough means to get the filtered data that we do not need to meddle with an already deprecated complete callback. You can call done on the jqXHR within the complete callback for instance.

comment:13 follow-up: ↓ 14 Changed 17 months ago by JamesMGreene

@jaubourg: I'm perfectly fine with leaving it as-is if the complete callback actually get axed. Is there a targeted milestone release for that yet? It's already hung around much longer than I expected.

comment:14 in reply to: ↑ 13 Changed 17 months ago by jaubourg

Replying to JamesMGreene:

@jaubourg: I'm perfectly fine with leaving it as-is if the complete callback actually get axed. Is there a targeted milestone release for that yet? It's already hung around much longer than I expected.

It will probably end up as one of these "deprecated but never removed" antics. complete is used for pretty much anything save for cooking breakfast. All we can do is show people how to handle stuff properly with 2 handlers or using always but the inconsistencies in signatures of the success and error callbacks makes complete so much more compelling in the "real world"(tm).

Note: See TracTickets for help on using tickets.