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

Differentiate between no default and empty string default. #13729

Closed
OlafvdSpek opened this Issue Oct 11, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@OlafvdSpek

OlafvdSpek commented Oct 11, 2017

The Structure tab does not show any difference between a field without default and one with an empty string as default. IMO it should.

@ankitjain28may

This comment has been minimized.

Show comment
Hide comment
@ankitjain28may

ankitjain28may Oct 14, 2017

Contributor

@nijel Yes, This is the bug,
We can show default values like this [default_value]
Ex- If default value is yes- It looks like this - [yes]
so if default value is - It looks like this- [ ]
What do u say ?

Contributor

ankitjain28may commented Oct 14, 2017

@nijel Yes, This is the bug,
We can show default values like this [default_value]
Ex- If default value is yes- It looks like this - [yes]
so if default value is - It looks like this- [ ]
What do u say ?

@nijel

This comment has been minimized.

Show comment
Hide comment
@nijel

nijel Oct 16, 2017

Member

Well, there already is code for handling this:

{% if row['Default'] is defined %}
{% if extracted_columnspec['type'] == 'bit' %}
{{ Util_convertBitDefaultValue(row['Default']) }}
{% else %}
{{ row['Default']|raw }}
{% endif %}
{% else %}
<em>{% trans %}None{% context %}None for default{% endtrans %}</em>
{% endif %}

However for some reason it's not triggered (the default value is always defined to empty string even if it is not set in the table).

Member

nijel commented Oct 16, 2017

Well, there already is code for handling this:

{% if row['Default'] is defined %}
{% if extracted_columnspec['type'] == 'bit' %}
{{ Util_convertBitDefaultValue(row['Default']) }}
{% else %}
{{ row['Default']|raw }}
{% endif %}
{% else %}
<em>{% trans %}None{% context %}None for default{% endtrans %}</em>
{% endif %}

However for some reason it's not triggered (the default value is always defined to empty string even if it is not set in the table).

@nijel nijel added the bug label Oct 16, 2017

@nijel nijel self-assigned this Oct 16, 2017

@nijel nijel added this to the 4.8.0 milestone Oct 16, 2017

@nijel nijel closed this in 35e15e9 Oct 16, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment