From 9a60b9d8a28b3269a7e94476c5a363573b71d9ab Mon Sep 17 00:00:00 2001 From: scardinius Date: Tue, 12 Apr 2016 15:12:40 +0200 Subject: [PATCH] CRM-18108 Fix choosing A/B testing as final --- ang/crmMailingAB/EditCtrl.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/ang/crmMailingAB/EditCtrl.js b/ang/crmMailingAB/EditCtrl.js index 914280125c..b189bafcd7 100644 --- a/ang/crmMailingAB/EditCtrl.js +++ b/ang/crmMailingAB/EditCtrl.js @@ -23,22 +23,26 @@ // TODO review fields exposed in UI and make sure the sync rules match switch (abtest.ab.testing_criteria) { case 'subject': - crmMailingMgr.mergeInto(abtest.mailings.b, abtest.mailings.a, [ + var exclude_subject = [ 'name', 'recipients', 'subject' - ]); + ]; + crmMailingMgr.mergeInto(abtest.mailings.b, abtest.mailings.a, exclude_subject); + crmMailingMgr.mergeInto(abtest.mailings.c, abtest.mailings.a, exclude_subject); break; case 'from': - crmMailingMgr.mergeInto(abtest.mailings.b, abtest.mailings.a, [ + var exclude_from = [ 'name', 'recipients', 'from_name', 'from_email' - ]); + ]; + crmMailingMgr.mergeInto(abtest.mailings.b, abtest.mailings.a, exclude_from); + crmMailingMgr.mergeInto(abtest.mailings.c, abtest.mailings.a, exclude_from); break; case 'full_email': - crmMailingMgr.mergeInto(abtest.mailings.b, abtest.mailings.a, [ + var exclude_full_email = [ 'name', 'recipients', 'subject', @@ -48,13 +52,14 @@ 'override_verp', // keep override_verp and replyto_Email linked 'body_html', 'body_text' - ]); + ]; + crmMailingMgr.mergeInto(abtest.mailings.b, abtest.mailings.a, exclude_full_email); + crmMailingMgr.mergeInto(abtest.mailings.c, abtest.mailings.a, exclude_full_email); break; default: throw "Unrecognized testing_criteria"; } } - crmMailingMgr.mergeInto(abtest.mailings.c, abtest.mailings.a, ['name']); return true; }; -- 2.25.1