Skip to content

Commit

Permalink
Merge pull request colemanw#136 from jitendrapurohit/tokenfix
Browse files Browse the repository at this point in the history
Allow token to be a default value for contribution amount
  • Loading branch information
KarinG authored May 1, 2018
2 parents eab47d5 + c2bc046 commit 9ade961
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion includes/wf_crm_admin_component.inc
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,11 @@ function wf_crm_cs_validate($form, &$form_state) {
function wf_crm_money_validate($form, &$form_state) {
$vals = $form_state['values'];
if (!empty($vals['value']) && !is_numeric($vals['value']) && $vals['type'] != 'formula') {
form_error($form['value'], t('This is a CiviCRM currency field. @field must be a number.', array('@field' => $form['value']['#title'])));
//Check if default value is a token string.
$isTokenString = token_replace($vals['value'], array(), array('clear' => true));
if (!empty($isTokenString)) {
form_error($form['value'], t('This is a CiviCRM currency field. @field must be a number.', array('@field' => $form['value']['#title'])));
}
}
foreach (array('items', 'options') as $field) {
if (!empty($vals['extra'][$field])) {
Expand Down

0 comments on commit 9ade961

Please sign in to comment.