<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.7 |
+ | CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2017 |
+ | Copyright CiviCRM LLC (c) 2004-2019 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2017
+ * @copyright CiviCRM LLC (c) 2004-2019
*/
/**
$attributes = CRM_Core_DAO::getAttribute('CRM_Core_DAO_UFField');
// weight
- $this->add('text', 'weight', ts('Order'), $attributes['weight'], TRUE);
+ $this->add('number', 'weight', ts('Order'), $attributes['weight'], TRUE);
$this->addRule('weight', ts('is a numeric field'), 'numeric');
$this->add('textarea', 'help_pre', ts('Field Pre Help'), $attributes['help_pre']);
$apiFormattedParams['location_type_id'] = $params['field_name'][2];
}
}
+ elseif ($params['field_name'][2] == 0) {
+ // 0 is Primary location type
+ $apiFormattedParams['location_type_id'] = NULL;
+ }
if (!empty($params['field_name'][3])) {
$apiFormattedParams['phone_type_id'] = $params['field_name'][3];
}