Skip to content

Fix "pushObjects is not a function" error #1100

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

Merged
merged 1 commit into from
Oct 23, 2017
Merged

Conversation

locks
Copy link
Contributor

@locks locks commented Oct 2, 2017

This is a bit of a quick patch to address the problem, we should dig some more into why it's happening.

Fixes #1099

[edit] I only checked config/environment.js for something disabling prototype extensions, and forgot to check package.json, which lists ember-disable-prototype-extensions.

@locks locks requested a review from Turbo87 October 2, 2017 11:07
@Turbo87
Copy link
Member

Turbo87 commented Oct 2, 2017

this seems necessary only for myFeed due to

this.get('myFeed').pushObjects(versions);

@locks
Copy link
Contributor Author

locks commented Oct 2, 2017

@Turbo87 my thought was let's keep it consistent. We could also do this.get('myFeed').push(...versions) if versions is a native array.

@Turbo87
Copy link
Member

Turbo87 commented Oct 2, 2017

we could, but then the array observers won't get notified for new items in the array

@carols10cents
Copy link
Member

Sorry this has taken me so long to look at-- I'm still getting _this.get(...).pushObjects is not a function on my dashboard page :-/

I'm going to see if I can get a test to fail for this...

@Turbo87
Copy link
Member

Turbo87 commented Oct 11, 2017

I'm still getting _this.get(...).pushObjects is not a function on my dashboard page

even after applying this patch?

@carols10cents
Copy link
Member

yep, on this branch

@carols10cents
Copy link
Member

does this branch fix it for you?

@carols10cents
Copy link
Member

Welp i just tried to make a test with a logged in user for the past few hours and i fail. Pushed my attempt to this branch, feel free to toss it if it's crap.

@Turbo87
Copy link
Member

Turbo87 commented Oct 21, 2017

@carols10cents @locks I finally got around to looking into this and after a while I managed to figure out how to setup everything so that auth works locally too.

tl;dr we missed controller.set('myFeed', []); in the dashboard route file

I've fixed the instruction and pushed the fix to this PR. I've also moved your test to a separate me-test branch to make CI pass again here, but we should definitely continue to explore how to add tests for these pages.

@Turbo87 Turbo87 requested review from carols10cents and removed request for Turbo87 October 21, 2017 19:07
@Turbo87 Turbo87 changed the title Fixes #1099 - "pushObjects is not a function" Fix "pushObjects is not a function" error Oct 21, 2017
@locks
Copy link
Contributor Author

locks commented Oct 21, 2017

@carols10cents can you 👍 or merge?

@carols10cents
Copy link
Member

Yay it works!!! Thank you!!!

bors: r+

bors-voyager bot added a commit that referenced this pull request Oct 23, 2017
1100: Fix "pushObjects is not a function" error r=carols10cents

This is a bit of a quick patch to address the problem, we should dig some more into why it's happening.

Fixes #1099

[edit] I only checked `config/environment.js` for something disabling prototype extensions, and forgot to check `package.json`, which lists [ember-disable-prototype-extensions](https://github.com/rust-lang/crates.io/blob/master/package.json#L49).
@bors-voyager
Copy link
Contributor

bors-voyager bot commented Oct 23, 2017

Build succeeded

@bors-voyager bors-voyager bot merged commit 77810e2 into master Oct 23, 2017
@Turbo87 Turbo87 deleted the locks-patch-1 branch October 23, 2017 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants