From: kurund Date: Mon, 8 Sep 2014 17:25:01 +0000 (+0530) Subject: CRM-15181, adv select fixes, for onbehalf profile X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d940bda2883fa33456d946e43ca86a4b3549eb8b;p=civicrm-core.git CRM-15181, adv select fixes, for onbehalf profile ---------------------------------------- * CRM-15181: on behalf of profile: adv multi-select fails with preset options https://issues.civicrm.org/jira/browse/CRM-15181 --- diff --git a/templates/CRM/Contribute/Form/Contribution/OnBehalfOf.tpl b/templates/CRM/Contribute/Form/Contribution/OnBehalfOf.tpl index b9181ecc6d..58e4ef82fc 100644 --- a/templates/CRM/Contribute/Form/Contribution/OnBehalfOf.tpl +++ b/templates/CRM/Contribute/Form/Contribution/OnBehalfOf.tpl @@ -201,7 +201,9 @@ function setOrgName( ) { function setLocationDetails(contactID , reset) { var submittedCID = {/literal}"{$submittedOnBehalf}"{literal}; var submittedOnBehalfInfo = {/literal}'{$submittedOnBehalfInfo}'{literal}; - submittedOnBehalfInfo = cj.parseJSON(submittedOnBehalfInfo); + if (submittedOnBehalfInfo) { + submittedOnBehalfInfo = cj.parseJSON(submittedOnBehalfInfo); + } if (submittedCID == contactID) { cj.each(submittedOnBehalfInfo, function(key, value) { cj('#onbehalf_' + key ).val(value); @@ -246,6 +248,7 @@ function setLocationDetails(contactID , reset) { // remove selected values from left and selected values to right cj('#onbehalf\\['+ customFld +'\\]-f option[value="' + selectedOption + '"]').remove() .appendTo('#onbehalf\\['+ customFld +'\\]-t'); + cj('#onbehalf_'+ customFld).val(selectedOption); } } else {