CiviDiscount "Codes Redeemed" data lost during merge procedure
Created by: abeconway
When you merge 2 duplicate individual records (using "Find and Merge Duplicate Contact Records under the Contacts menu) together that both contain "Codes Redeemed", that CiviDiscount data is completely lost/deleted and NOT merged into the final record.
Here is the merge screen, notice there is nothing about merging the CiviDiscount data:
Here is what MySQL says BEFORE the merge: mysql> select id,item_id,contact_id,contribution_id from cividiscount_track where contact_id IN (66855,2492); +------+---------+------------+-----------------+ | id | item_id | contact_id | contribution_id | +------+---------+------------+-----------------+ | 157 | 28 | 2492 | 16023 | | 757 | 73 | 2492 | 17309 | | 1501 | 73 | 66855 | 18229 | +------+---------+------------+-----------------+ 3 rows in set (0.00 sec)
Here is what MySQL says AFTER the merge: mysql> select id,item_id,contact_id,contribution_id from cividiscount_track where contact_id IN (66855,2492); +-----+---------+------------+-----------------+ | id | item_id | contact_id | contribution_id | +-----+---------+------------+-----------------+ | 157 | 28 | 2492 | 16023 | | 757 | 73 | 2492 | 17309 | +-----+---------+------------+-----------------+ 2 rows in set (0.00 sec)
If you check the Discount Code usage in the CiviCRM Discount Codes Page, it also has no record of the usage, example: Before the merge it would say 2/10 codes used, but AFTER the merge is reports 1/10 codes used.
CiviCRM 4.4.20 CiviDiscount 2.6 Drupal 6.37