----------------------------------------
* CRM-18263: copy profile broken
https://issues.civicrm.org/jira/browse/CRM-18263
* @return \CRM_Core_DAO
*/
public static function copy($id) {
- $fieldsFix = array('prefix' => array('title' => ts('Copy of ')));
+ $maxId = CRM_Core_DAO::singleValueQuery("SELECT max(id) FROM civicrm_uf_group");
+
+ $title = ts('[Copy id %1]', array(1 => $maxId + 1));
+ $fieldsFix = array(
+ 'suffix' => array(
+ 'title' => ' ' . $title,
+ 'name' => '__Copy_id_' . ($maxId + 1) . '_',
+ ),
+ );
+
$copy = &CRM_Core_DAO::copyGeneric('CRM_Core_DAO_UFGroup',
array('id' => $id),
NULL,