Commit 074d886d authored by Stefan Tauner's avatar Stefan Tauner
Browse files

Use 'depends_on' value for enablements checks only if its type is boolean

parent a3cd32be
...@@ -202,7 +202,8 @@ logo_end ...@@ -202,7 +202,8 @@ logo_end
# where values present in the input are not validated at all. # where values present in the input are not validated at all.
# - depends_on (optional) specifies the key of another constant. # - depends_on (optional) specifies the key of another constant.
# The respective constant is only relevant (and thus required as input) # The respective constant is only relevant (and thus required as input)
# if the value of the referenced constant is true. # if the value of the referenced constant is of type boolean and its value true.
# Additionally, the values function will get the value of the depends_on setting passed.
# - group (optional) specifies how to group this value in output. Value will not be displayed if undef # - group (optional) specifies how to group this value in output. Value will not be displayed if undef
# - order (optional) specifies how to sort this value in output group # - order (optional) specifies how to sort this value in output group
# - noedit (optional) display value, but don't allow to alter # - noedit (optional) display value, but don't allow to alter
...@@ -860,8 +861,9 @@ use constant FIUMAP => \%fiumap; ...@@ -860,8 +861,9 @@ use constant FIUMAP => \%fiumap;
# where no value must be present in input (e.g. ID is only necessary while downloading). # where no value must be present in input (e.g. ID is only necessary while downloading).
# - gui_modes (optional) specifies in which mode of {manual,auto,random} this key will be displayed in the GUI # - gui_modes (optional) specifies in which mode of {manual,auto,random} this key will be displayed in the GUI
# - depends_on (optional) specifies the key of another constant. # - depends_on (optional) specifies the key of another constant.
# The respective constant is only relevant (and thuse required as input) # The respective constant is only relevant (and thus required as input)
# if the value of the referenced constant is true. # if the value of the referenced constant is of type boolean and its value true.
# Additionally, the values function will get the value of the depends_on setting passed.
# - order (optional) specifies how to sort this value in output group # - order (optional) specifies how to sort this value in output group
# - default (optional) default value if not given in file and not determinable otherwise. # - default (optional) default value if not given in file and not determinable otherwise.
# Can either be a scalar or a function pointer expecting a FIJI settings reference. # Can either be a scalar or a function pointer expecting a FIJI settings reference.
......
...@@ -1614,7 +1614,7 @@ sub _validate_entry { ...@@ -1614,7 +1614,7 @@ sub _validate_entry {
if (defined($map->{$name}->{'depends_on'})) { if (defined($map->{$name}->{'depends_on'})) {
$dep_ref = \$self->{'settings'}->{'design'}->{$map->{$name}->{'depends_on'}}; $dep_ref = \$self->{'settings'}->{'design'}->{$map->{$name}->{'depends_on'}};
# don't validate if this entry is disabled # don't validate if this entry is disabled
if ($$dep_ref == 0) { if ($map->{$name}->{'type'} eq 'boolean' and $$dep_ref == 0) {
$logger->debug("Don't validate $name as it is disabled."); $logger->debug("Don't validate $name as it is disabled.");
$self->_indicate_warning($widget, 0, $map, $name); $self->_indicate_warning($widget, 0, $map, $name);
return undef; return undef;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment