From bbca3bdc4840897df0f4a59955d0f50ae0a1d227 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Sat, 25 Feb 2017 09:37:18 +0100 Subject: [PATCH 1/1] 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. --- src/PVE/SectionConfig.pm | 4 ++++ 1 file changed, 4 insertions(+) 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; } -- 2.39.2