Skip to content
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

currentWhen.split is not a function #12296

Closed
Dhaulagiri opened this issue Sep 4, 2015 · 16 comments
Closed

currentWhen.split is not a function #12296

Dhaulagiri opened this issue Sep 4, 2015 · 16 comments

Comments

@Dhaulagiri
Copy link
Contributor

Upgrading from 1.12 to 1.13.9 I'm seeing a an issue using the current-when argument on a link-to helper resulting in an error Uncaught TypeError: currentWhen.split is not a function. This twiddle demonstrates the problem which seems to occur regardless of if currentWhen is defined or not.

Note that the problem doesn't persist if I set current-when directly to a string in the template, but we need to be able to set this dynamically.

@xtian
Copy link
Contributor

xtian commented Sep 11, 2015

Looks like this is fixed in canary:
http://ember-twiddle.com/50efad9f9a81c9b5613b

@rwjblue
Copy link
Member

rwjblue commented Sep 11, 2015

Awesome, thanks for checking/confirming!

@rwjblue rwjblue closed this as completed Sep 11, 2015
@Dhaulagiri
Copy link
Contributor Author

Will that fix be back ported to 1.13 @rwjblue?

@rwjblue
Copy link
Member

rwjblue commented Sep 11, 2015

@Dhaulagiri - I'm not sure which commit fixes it. I am not opposed to backporting if someone tracks it down, and it is safe enough for immediate release.

@Dhaulagiri
Copy link
Contributor Author

I can try to look, but I'm not super familiar with the Ember code base. This is a blocking issue for our 1.13 upgrade though so I will try to make some time.

@stefanpenner
Copy link
Member

@rwjblue I would like for us to chat about this class of issue at the meeting today. We need a stance on upgrade blocking bugs, as they can undermine our ease of upgrade goals.

Obviously we cannot fix all. But I want to make sure everyone's understanding is aligned.

@Dhaulagiri
Copy link
Contributor Author

This is also fixed in 2.0. The difference seems to be in this particular case that current-when is an object in 1.13 wheres in >= 2.0 (and presumably 1.12), it is a string.

@stefanpenner
Copy link
Member

A quick glance suggests we are leaking MUTABLE_CELL

screen shot 2015-09-11 at 2 46 09 pm

@stefanpenner
Copy link
Member

ya we are leaking it and potentially others here

@stefanpenner
Copy link
Member

@wycats hinted at get-value

a quick check confirms getValue instead of direct attrs interaction will solve the issue.

Ember.__loader.require("ember-htmlbars/hooks/get-value").default(view.attrs['current-when'])

So all the attrs[..] calls, should be replace with getValue(attrs[...])

example:

import getValue from 'ember-htmlbars/hooks/get-value';
...

var currentWhen getValue(attrs['current-when'])

@stefanpenner
Copy link
Member

@Dhaulagiri do you have any spare cycles to do ^^ ?

@Dhaulagiri
Copy link
Contributor Author

@stefanpenner provided I can get some guidance as needed I'm happy to do the leg work early next week

@Dhaulagiri
Copy link
Contributor Author

Closed by #12344

@stefanpenner
Copy link
Member

thanks @Dhaulagiri :)

@rlivsey
Copy link
Contributor

rlivsey commented May 5, 2016

I'm seeing this again in current canary, not sure when it regressed

@phcoliveira
Copy link

I am also seeing this again with Ember 2.8.0 LTS.

whatthewhat added a commit to whatthewhat/ember.js that referenced this issue Jan 18, 2017
As the docs say, `A link will be active if current-when is true`.
Looks like this might have been broken since 1.13 and emberjs#12344
did not seem to actually fix this particular bug.

Related issues:

- emberjs#12512
- emberjs#12630 (fix was not merged)
- emberjs#12296
whatthewhat added a commit to whatthewhat/ember.js that referenced this issue Jun 26, 2017
As the docs say, `A link will be active if current-when is true`.
Looks like this might have been broken since 1.13 and emberjs#12344
did not seem to actually fix this particular bug.

Related issues:

- emberjs#12512
- emberjs#12630 (fix was not merged)
- emberjs#12296
rwjblue pushed a commit that referenced this issue Aug 8, 2017
As the docs say, `A link will be active if current-when is true`.
Looks like this might have been broken since 1.13 and #12344
did not seem to actually fix this particular bug.

Related issues:

- #12512
- #12630 (fix was not merged)
- #12296

(cherry picked from commit d0f320a)
locks added a commit that referenced this issue Aug 16, 2017
# This is the 1st commit message:
typo in comment

# The commit message #2 will be skipped:

#	indent yuidoc comment

# The commit message #3 will be skipped:

#	remove IE8 test

# The commit message #4 will be skipped:

#	remove commented out test

# The commit message #5 will be skipped:

#	use file path and add imports
#
#	Used RFC #176 modules API for imports.
#	Also cleaned up some of the globals-mode usage.

# The commit message #6 will be skipped:

#	clean up more globals style documentation

# The commit message #7 will be skipped:

#	Updates blueprints

# The commit message #8 will be skipped:

#	remove extra type check

# The commit message #9 will be skipped:

#	[BUGFIX beta] Reusing element causes problems in Safari
#
#	When testing allowed input types, in some versions of Safari the type
#	cannot be change to `file` if previously set to a different one.
#
#	Fixes #14727

# The commit message #10 will be skipped:

#	[DOC release]missed code block added

# The commit message #1 will be skipped:

#	[DOC release] Update wait.js - Add missing backticks to code snippet.

# The commit message #2 will be skipped:

#	use safe `toString` for array content in `mixins/array`

# The commit message #3 will be skipped:

#	avoid expanding already expanded property key in computed.sort

# The commit message #4 will be skipped:

#	avoid expanding already expanded property key in reduceMacro/arrayMacro/multiArrayMacro

# The commit message #5 will be skipped:

#	[DOC release] Make `Ember.expandProperties` public

# The commit message #6 will be skipped:

#	reuse meta `arrayContentDidChange`

# The commit message #7 will be skipped:

#	replace `throw` with assertion in `enumerable`

# The commit message #8 will be skipped:

#	[BUGFIX beta] Allow boolean values for current-when
#
#	As the docs say, `A link will be active if current-when is true`.
#	Looks like this might have been broken since 1.13 and #12344
#	did not seem to actually fix this particular bug.
#
#	Related issues:
#
#	- #12512
#	- #12630 (fix was not merged)
#	- #12296

# The commit message #9 will be skipped:

#	remove unused imports

# The commit message #10 will be skipped:

#	[DOC] Improve Ember.isEmpty

# The commit message #1 will be skipped:

#	micro optimization in `enumerable`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants