CRM_Contribute_Form_SoftCredit::addPCPFields($form, "[$rowNumber]");
}
elseif ($fieldName == 'currency') {
- $form->addCurrency($name, $title, $required);
+ $form->addCurrency($name, $title, $required, NULL, FALSE, FALSE);
}
elseif ($fieldName == 'contribution_page_id') {
$form->add('select', $name, $title,
* @param bool $required
* @param string $defaultCurrency
* @param bool $freezeCurrency
+ * @param bool $setDefaultCurrency
*/
public function addCurrency(
$name = 'currency',
$label = NULL,
$required = TRUE,
$defaultCurrency = NULL,
- $freezeCurrency = FALSE
+ $freezeCurrency = FALSE,
+ $setDefaultCurrency = TRUE
) {
$currencies = CRM_Core_OptionGroup::values('currencies_enabled');
$options = array('class' => 'crm-select2 eight');
$config = CRM_Core_Config::singleton();
$defaultCurrency = $config->defaultCurrency;
}
- $this->setDefaults(array($name => $defaultCurrency));
+ // In some case, setting currency field by default might override the default value
+ // as encountered in CRM-20527 for batch data entry
+ if ($setDefaultCurrency) {
+ $this->setDefaults(array($name => $defaultCurrency));
+ }
}
/**