Records appear twice (duplicated) in listview, but only one exports(correct number)

Hi

After running a large update/insert via the contacts import wizard, the number of updated records reported in list view, when I filter for the updated records is higher than it should be.

However, when I Select All and export, the correct number of records exports! When I scan through the list I can see some records appear to be duplicated, but they do not export duplicated.

It’s seems like some sort of database corruption, or some other sort of corruption has occurred, can anyone shed any light on this, I’ve really no idea where to start looking?

I’ve restarted services and done the Quick Repair and Rebuild, neither fixed the issue.

Thanks

Luke

By any chance: have you created some custom relationship which replicates other existing relationship? This may be the cause of duplicated records in listview. If this is the source of the issue then it’s normal behaviour.

Does this happen everywhere or just in some modules?

1 Like

Many thanks for the reply!

I’ve only noticed this in the contacts module after I did the insert/update. I gave all 2444 records a code in a field so that I could search for them after the upload, when I did search for them, Listview showed me 2561 records, which is when I noticed some of the records duplicated.

It’s an interesting point you raise about the relationships, there is a custom module related to the contacts, but it’s not used at all for these records.

Now I’ve noticed that one of each duplicate has the correct company name, the other just has a dot for the company name, so it’s looking like something to do with that.

Thanks again!

Luke

Hi

I’ve downloaded the tables from MySQL and discovered that the duplicates in listview are caused by orphaned relationships in the accounts_contacts table, each pair of duplicate contact Ids relate to an account that does exists, and an account that doesn’t exists.

I will upload a table of IDs to delete the records that have relationships to non existent accounts.

Thanks again for your input.

Luke

I recommend that, before you delete anything, you study the DataBase to find other relationships with other modules, or else you will end up with plent of orphaned records in other tables.

For example, contacts may be related to emails, email addresses, accounts and more. Emails, may be related to email_text, etc…

email_addresses may be related to other contacts as well as wto one or more accounts.

You have to be extremely careful because:
a. you want to remove all orphaned data
b. while doing so you don’t want to remove data that is orphaned for a contact but is not orphaned for other modules!

Thanks, you’re right, deleting data is always a bit daunting!

The account_ids relate to accounts that do not exist, the corresponding contact_ids are duplicates, the duplicates of which have accounts that do exist.

I think this has come about buy undoing and import/insert.