Page 1 of 1

"Check for duplicate" is not consistent in 5.4.0

Posted: Tue May 06, 2008 1:53 am
by mahebha26
I'm not sure if this is happening in previous versions of OpenEMM.

I have turned on the "Check for duplicates" as described in http://www.openemm.org/wiki/11_Forms_-_ ... new_action

I'm using "email" as the key-column.

When I add a new user (Recipient), with an email, which is already in the system, the existing user's details is updated and returned. Although this is bad, it does not create a duplicate user with the same email. I have already raised it as a bug in http://www.openemm.org/forums/ftopic726.html

But when I update the user with an existing user's email, it just updates. And in the Overview, I could see two users with the same email. This is bad. It should throw an error message "Email is already registered.". Or at-least be consistently bad like the bug in "creating a new user".

Please refer to the OpenEMM source code, SubscribeCustomer.java, method
executeOperation(), between lines 118 and 124:

if(aCust.getCustomerID()==0) {
if(this.doubleCheck) {
Map req = newCaseInsensitiveMap((HashMap)params.get("requestParameters"));
keyVal=(String)(req).get(this.keyColumn);
aCust.findByKeyColumn(this.keyColumn, keyVal);
}
}

This code checks for duplicates, only when the customerId is 0, which
happens for new subscribers only. Hence, the data duplicates while
updating the profile. The code could be, without the check for customerId, to make it work in both cases.

Thank you.


Regards
Balaji