From: Dietmar Maurer Date: Sat, 25 Feb 2017 08:37:18 +0000 (+0100) Subject: SectionConfig::check_value: return bool/numbers as numeric value X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=bbca3bdc4840897df0f4a59955d0f50ae0a1d227 SectionConfig::check_value: return bool/numbers as numeric value This is important when we convert the result to JSON. Else the GUI receives booleans as "0", which evaluate to true in JS! NOTE: "0" evaluates to false with perl. --- diff --git a/src/PVE/SectionConfig.pm b/src/PVE/SectionConfig.pm index e489b7c..b1e96a4 100644 --- a/src/PVE/SectionConfig.pm +++ b/src/PVE/SectionConfig.pm @@ -259,6 +259,10 @@ sub check_value { } } + if ($ct eq 'boolean' || $ct eq 'integer' || $ct eq 'number') { + return $value + 0; # convert to number + } + return $value; }