Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Commit

Permalink
fix(install): fix update of policy properties
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry authored and DIOHz0r committed May 10, 2018
1 parent 523567f commit f5d0251
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions install/installer.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,11 @@ protected function createPolicies() {

$symbol = $policyData['symbol'];
$rows = $policy->find("`symbol`='$symbol'");
$policyData['type_data'] = json_encode($policyData['type_data'],
JSON_UNESCAPED_SLASHES
);
if (count($rows) == 0) {
// Create only non existing policy objects
$policyData['type_data'] = json_encode($policyData['type_data'],
JSON_UNESCAPED_SLASHES);
$policy->add($policyData);
} else {
// Update default value and recommended value for existing policy objects
Expand All @@ -345,6 +346,7 @@ protected function createPolicies() {
'id' => $policy2->getID(),
'default_value' => $policyData['default_value'],
'recommended_value' => $policyData['recommended_value'],
'type_data' => $policyData['type_data'],
'plugin_flyvemdm_policycategories_id' => $categoryId,
]);
}
Expand Down

0 comments on commit f5d0251

Please sign in to comment.