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
Channel Form: Unexpected default value behavior as placeholder #154
Comments
The reason for this behavior is that a default may change. If a default is stored that way, it never changes automatically. If the default is not applied by the channel plugin, this needs to be fixed. |
Fair enough. But then it should be reflected in the database that the default value should be used. This would also bring up the question how to distinct an empty or |
Usually, a non existing value for a config option means to use the default. In this case, |
As I just stumbled about this again: configuring a This is a bit frustrating, as I am unable to catch this on the backend by replacing an empty value to the configured default because the web dialog forbids submitting an empty form. However, when I starts typing, the shown |
Have you seen Icinga/icinga-notifications#172? |
Now I've seen it. It kinda addresses this very issue. |
Describing a channel holding a configuration option with a non empty default field results in this default being rendered as the input's placeholder (
<input placeholder="…">
). However, when creating or editing this channel through web, this placeholder value will not be reflected in the database and is not used as a default.As a concrete example, let's start with the following Go snippet:
This results in the following
available_channel_type
entry:Within the web, the following output will be generated:
However, when now saving this entry with the placeholder value, it will be written as
null
to the database:I would expect a default named field to create a default value which will be used when no other value was entered.
The text was updated successfully, but these errors were encountered: