-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Calling _super in a CP has the wrong context when retrieved from an action #13230
Comments
Yup, seems like a bug. @offirgolan if you have cycles a failing test would be sweet, im going to skim the code and see what may be going sideways. |
I believe the issue is, the cp has no super so it doesn't bother super wrapping it. But if it does not super wrap it, it doesn't reset the actions https://github.com/emberjs/ember.js/blob/master/packages/ember-metal/lib/mixin.js#L105-L107. The above code should insert a no-op super wrapper if no super descriptor is found, rather then circuiting. I believe this should be a pretty quick fix, but it is unlikely I will be able to look at it more closely until Sunday. If no-one else does, and if i forgot please ping me :P |
👍 Sweet will do. I dont have too much free time unfortunately, but if I find a spare moment, ill whip up a test. Thanks for taking this on! |
Submitted #13242 with a couple tests and fix. Needs review. |
👌 thanks Rob On Sunday, April 3, 2016, Robert Jackson notifications@github.com wrote:
Thanks, |
See #13242 (comment) for an update. I'm going to close this for now, and track the underlying issue in #13242 instead. Thank you for reporting, hopefully we can get something in place to help prevent this sort of trollage in the near future. |
In an Ember.Object, when you call
this._super
in a CP, it will retrieve the parent's value of that same property. What was found is that when you fetch a CP that has a_super
call in an action handler, the_super
context is that of the parent's action and not of the parent's CP.Ember Twiddle - Tested on Ember 1.13.13 to Canary
When you click the save button, the following should happen:
my-component
action should be called which at the end calls_super
(defined in CRUD mixin)What is actually happening:
_super
in validations objects calls the CRUD mixin save action instead of inherited validations cp_super
(defined in CRUD mixin)The text was updated successfully, but these errors were encountered: