From ec9852f1a5c8e0b0b0bdf016e159bbd605962760 Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Wed, 22 Nov 2023 21:44:36 +0000 Subject: [PATCH] Fix saving/loading of conditionals on 5.67+ --- .../admin/ang/afGuiEditor/afGuiConditionalDialog.ctrl.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ext/afform/admin/ang/afGuiEditor/afGuiConditionalDialog.ctrl.js b/ext/afform/admin/ang/afGuiEditor/afGuiConditionalDialog.ctrl.js index 379b8b1894..cd9893f001 100644 --- a/ext/afform/admin/ang/afGuiEditor/afGuiConditionalDialog.ctrl.js +++ b/ext/afform/admin/ang/afGuiEditor/afGuiConditionalDialog.ctrl.js @@ -14,13 +14,16 @@ if (!ctrl.conditions.length) { delete ctrl.node['af-if']; } else { - ctrl.node['af-if'] = '(' + JSON.stringify(ctrl.conditions) + ')'; + ctrl.node['af-if'] = '(' + JSON.stringify(ctrl.conditions).replace(/"/g, '"') + ')'; } dialogService.close('afformGuiConditionalDialog'); }; function parseConditions() { - var ngIf = _.trim(ctrl.node['af-if']); + if (!ctrl.node['af-if']) { + return []; + } + var ngIf = _.trim(ctrl.node['af-if'].replace(/"/g, '"')); if (!_.startsWith(ngIf, '(')) { return []; } -- 2.25.1