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

[TC-478] Parameter value can be changed to 0 #758

Closed
wants to merge 1 commit into from
Closed

[TC-478] Parameter value can be changed to 0 #758

wants to merge 1 commit into from

Conversation

nir-sopher
Copy link
Contributor

No description provided.

@@ -317,7 +317,7 @@ sub update {

my $name = $params->{name} || $find->name;
my $configFile = $params->{configFile} || $find->config_file;
my $value = $params->{value} || $find->value;
my $value = exists($params->{value}) ? $params->{value} : $find->value;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this allow you to do? to set the parameter value to null? is that what you want to do?

it sounds like by the name of the PR you want to set a parameter value to 0...but parameter values are strings so can you set the value to "0" without this change? and is that sufficient?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to allow to set the value to 0.

Apparently in Perl the string "0" is equivalent to False....
See http://www.perlmonks.org/?node=what%20is%20true%20and%20false%20in%20Perl%3F

I can replace the "exists" with "defined" if you prefer. I believe that logically "exists"is better, but it really does not matter for this case

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, makes sense. i forgot how perl treats 0 or "0"

@asfgit asfgit closed this in d17cded Aug 3, 2017
@mitchell852 mitchell852 self-assigned this Dec 14, 2017
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