Merge pull request #6698 from jitendrapurohit/CRM-17169
[civicrm-core.git] / api / api.php
index 4f53c542fc0324b54e6361ee65a70ba28f963cc5..8b55d97347e26335c6a7e5a35d93db3ac4556a8d 100644 (file)
@@ -158,6 +158,10 @@ function _civicrm_api_replace_variables(&$params, &$parentResult, $separator = '
           $count = count($stringParts);
         }
       }
+      // CRM-16168 If we have failed to swap it out we should unset it rather than leave the placeholder.
+      if (substr($params[$field], 0, 6) == '$value') {
+        $params[$field] = NULL;
+      }
     }
   }
 }