Skip to content

Commit

Permalink
Merge pull request #6 from dawb/patch-1
Browse files Browse the repository at this point in the history
Adding ability to post through multi select options
  • Loading branch information
mediabeastnz authored Jul 6, 2020
2 parents 3ecdc8e + f240db2 commit 9975b8d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion code/extensions/EditableCampaignMonitorField.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,17 @@ public function getCustomFields(Array $data)
// loop through the submitted data and check for custom fields
foreach($data as $key=>$value){
if(count(explode('customfield_',$key)) > 1){
$custom_fields[] = array("Key" => substr($key, 12), "Value" => $value);
if(is_array($value)){
$newValue = '';
$i=1;
foreach($value as $k => $v){
$newValue .= $i == 1 ? $v : '||' . $v;
$i++;
}
$custom_fields[] = array("Key" => substr($key, 12), "Value" => $newValue);
} else {
$custom_fields[] = array("Key" => substr($key, 12), "Value" => $value);
}
}
}

Expand Down

0 comments on commit 9975b8d

Please sign in to comment.