Ajax.InPlaceEditor seems to call the onComplete callback also when simply cancelling an InPlaceEditor
Reported by Sam Grönblom | September 15th, 2009 @ 09:22 AM
I got an error about an undefined transport (the Ajax.Response object) parameter in my onComplete function for an InPlaceEditor. Since the callback is named onComplete you would assume it would follow the same conventions as the standard Ajax options callbacks. "When used on individual instances, all callbacks (except onException) are invoked with two parameters: the XMLHttpRequest object and the result of evaluating the X-JSON response header, if any (can be null)."
However, when you simply cancel an editor there is no request made and therefore no transport parameter. I noticed that the Ajax.InPlaceEditor calls handleFormCancellation which calls wrapUp which calls _boundComplete. The problem was easily circumvented by just testing if (transport) in my onComplete callback, but it still seems wrong that IPE works this way.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Source available from github
The Git repository resides at:
Check out the current development trunk with:
git clone git://github.com/madrobby/scriptaculous.git
As script.aculo.us 1.xx is feature-frozen, this development trunk is for bugfixes only.
New development should happen only for
Creating a bug report
When creating a bug report, be sure to include as much relevant information as possible. Post a an example that shows off the problem. Preferably, alter the unit tests and show through either changed or added tests how the expected behavior is not occuring.