This worked for me, file participants-database.php. On lines 1010 to 1025 you will find this code. Change each instance of “email” to be the column name you want to use to identify duplicates. In my case the column name was soldier_number. Where you now see soldier_number is where you have to make changes, remember column name, NOT column title must be used. If I haven’t changed something such as “unique_email” or “$email” then don’t change it.
$options = get_option( self::$participants_db_options );
// check for an existing record with same email so we can at least avoid
// inserting a duplicate email address into the database
if ( $options['unique_email'] && isset( $post['soldier_number'] ) && ! empty( $post['soldier_number'] ) && self::email_exists( $post['soldier_number'] ) ) {
// record with same email exists...get the id and update the existing record
$participant_id = self::_get_participant_id_by_term( 'soldier_number', $post['soldier_number'] );
// if there is more than one record with a particular email, return the first one
if ( is_array( $participant_id ) ) $participant_id = current( $participant_id );
//unset( $post['private_id'] );
$action = 'update';
}
Then on lines 1257 to 1267 you will find this code:
/**
* tests for the presence of an email address in the records
*
* @param string $email the email address to search for
* @return boolean true if email is found
*/
public function email_exists( $email ) {
return self::_id_exists( $email, 'soldier_number' );
}
Change the “email” to be your column name here as well.
Then do some testing. Hope this works for you.
Wayne
Yes, this worked well, and I was able to import updated data into existing records based on the private_id field (instead of email address which I am not using in my participants list) set as the field to check when evaluating possible duplicates. Thanks!