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

Outdated warning when using default filter #566

Closed
kaylynb opened this issue Oct 28, 2015 · 1 comment
Closed

Outdated warning when using default filter #566

kaylynb opened this issue Oct 28, 2015 · 1 comment

Comments

@kaylynb
Copy link
Contributor

kaylynb commented Oct 28, 2015

When using a default filter without specifying boolean, nunjucks displays an outdated deprecation warning.

Ex:

{{ x | default('y') }}

produces the following warning:

[nunjucks] Warning: the "default" filter was used without specifying the type of comparison. 2.0 changed the default behavior from boolean (val ? val : def) to strictly undefined, so you should make sure that doesn't break anything. Be explicit about this to make this warning go away, or wait until 2.1. See http://mozilla.github.io/nunjucks/templating.html#defaultvalue-default-boolean

The warning says 'or wait until 2.1.', and the documentation says it will be removed in the next version.

Appears to still be in master as of today:

nunjucks/src/filters.js

Lines 70 to 77 in 90e3913

console.log(
'[nunjucks] Warning: the "default" filter was used without ' +
'specifying the type of comparison. 2.0 changed the default ' +
'behavior from boolean (val ? val : def) to strictly undefined, ' +
'so you should make sure that doesn\'t break anything. ' +
'Be explicit about this to make this warning go away, or wait until 2.1. ' +
'See http://mozilla.github.io/nunjucks/templating.html#defaultvalue-default-boolean'
);

Does this need a PR to update documentation and/or remove the warning?

@carljm
Copy link
Contributor

carljm commented Oct 29, 2015

Closed with merge of #567.

@carljm carljm closed this as completed Oct 29, 2015
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

No branches or pull requests

2 participants