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

Replace null coalescing operator with elvis operator #2678

Closed
wants to merge 1 commit into from
Closed

Replace null coalescing operator with elvis operator #2678

wants to merge 1 commit into from

Conversation

jawngee
Copy link

@jawngee jawngee commented Oct 19, 2020

Replace null coalescing operator with elvis operator so that empty strings return the default value. Fix for #2677

@jasonvarga
Copy link
Member

Thank you for the PR but I don't think this is quite the right solution.

If you have a field where you explicitly define an empty string as the value, it'll use the default.

# blueprint
-
  handle: something
  field:
    type: text
    default: 'the default'
# content
---
something: ''
---

Before this change, it'll show "". After, it'll show "the default".

@jasonvarga jasonvarga closed this Oct 20, 2020
@jasonvarga
Copy link
Member

Your issue is solved in c07e641

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.

2 participants