Deleting One Citation in Edit Person Can Delete Another Citation at the Same Time

First let me describe how to recreate the problem. After that, I will describe how I discovered the problem and why I think it’s a bug that needs to be fixed.

  1. From the Edit Person screen, add a new citation. It doesn’t seem to matter whether the citation is using the free form template, a built-in template, or a user defined template. It doesn’t seem to matte whether the citation is for a person or for a family or for a fact or for a name.
  2. Memorize the new citation.
  3. Paste/Reuse the citation back into the same item from which it was memorized. At this point, the citation will have been duplicated for that person or family or fact or name. You would never do this on purpose, but this is the easiest way to recreate the problem.
  4. Delete one of the duplicate citations. The other duplicate citation will also be deleted at the same time. It seems to me that just the one duplicate citations should have been deleted and that this is a bug.

I discovered by accident that I had one citation duplicated in this manner in RM7. There is no way that I know of to find these kinds of duplicate citations in either RM7 or RM8, so I wrote an SQLite script to find them. I had about 100 citations out of about 86,000 citations in my database that had this problem. They were all citations from about 25 years ago in the Family Origins days. I can’t determine exactly how these few citations became duplicated in this manner and how a vastly larger number of citations did not become duplicated in this manner. But the duplicate citations are there, and I need to clean them up. So I commenced the process.

My standard workflow at the present time is to delete my RM8 database every morning, to import my RM7 database into RM8 every morning, and to repeat all my data entry each day into both RM7 and RM8. So I started using my SQLite script to find the oddly duplicated citations in RM7 and proceeded to delete the duplicates from both RM7 and RM8. I had to develop a very different workflow to do the deletes in RM8 than to do the deletes in RM7. That’s an interesting story in and of itself, but I came up with a way to delete the duplicate citations in RM8 that’s just as easy as as it is in RM7 and that’s a good thing. So far, so good.

When and if I quit using RM7 and switch totally over to RM8, I will do a Merge Duplicate Citations in RM8. The Merge Duplicate Citations tool doesn’t so much merge duplicate citations as it converts duplicate copied citations to reusable citations. This is an essential step in converting to RM8 because otherwise duplicate citations cannot be combined in endnote lists in reports.

It takes about 30 minutes to run RM8’s Merge Duplicate Citations tool against my database, so I usually skip that step each morning unless something I’m going to be doing that day that depends on having my RM8 citations properly merged. But I decided that I had better test the process of deleting duplicate citations for the same person, family, fact, or name from RM8. So I took the extra half hour to run RM8’s Merge Duplicate Citations tool against my database and then I deleted a duplicate citation. But RM8 deleted both the duplicate and the original.

Well, first I verified that RM8’s Merge Duplicate Citations tool does not merge duplicate citations when they are assigned to the same person, family, fact, or name. It does not. Then I tried deleting one of the duplicates by hand. That’s when I discovered that RM8 was deleting both duplicates. It only deletes both citations when they are reused, not when they are copied. And it only deletes both citations when they are attached to the same person, family, fact, or name. There is no problem when different persons, families, facts, and names have the same reused citation. I really hope that this issue is accepted as a bug and that it is fixed at some point.

It occurs to me that a work around would be to Memorize one of the duplicated citations for the same person, family, fact, or name and Paste/Copy it back into the same person, family, fact, or name. Then I could delete the originally duplicated citations without losing my citations. But that seems extraordinarily convoluted. And I would still need to run RM8’s Merge Duplicate Citations again because the same citation is likely to have been used by some other person, family, fact, or name.

1 Like

I had many duplicated citations in RM when I first imported my TMG project.
In TMG, one adds source citations documenting the parental relationship and the maternal relationship separately. Often the same citation was used for both. When imported, both got assigned to a new fact called Child parent resulting in thousands of duplications.
I’ve been fixing these as I come across them. It is a constant reminder of a bad import decision.

Deleting duplicate citation links are no different than when you delete a duplicate child link in a family. Delete one link and the duplicate will be deleted too. In RM7 the links are independent of each other. You could not reuse the citations so you would never experience deleting a duplicate citation removing another citation.

In your experiment if you tried memorizing the citation and then deleting it, then using paste, reuse, it would add it back again. Even if you deleted the link after pasting and had two of them the ability to paste and reused will still be there. This works because you are memorizing a link that can be reused, even if nothing else is using it. In RM7 once it was gone it was gone.

I’ve been doing the memorize-delete-paste routine for a long time in RM8 when I find duplicate citations associated to a fact or person. I think the duplicate citation issue may be related to TreeShare for Ancestry.

Much to my surprise, deleting one duplicate child link in a family will delete the other as well. I had never encountered that exact situation in all my 25 years with Family Origins and RootsMagic. The exact same thing happens in both RM7 and RM8. So I think your analogy between deleting child links and citation links in RM8 is very apt.

But at the same time, I think this behavior is a terrible bug for child links (both RM7 and RM8) and for reused citation links (RM8 only). There really are two links in the database that equal to each other, Why should deleting the one link delete the other link? It’s like what if by accident I enter the same transaction into my check register software twice. Should deleting one transaction delete both so that I have to enter the transaction again? I should hope not.

This does work, and it’s interesting that Ole Seminole discovered both the problem and the solution already.

But here is a question. How do you know just by looking if two duplicate citations for the same person or fact have been reused or not? You really can’t tell, so there is no way to know ahead of time whether this special treatment of memorizing before deleting so you can paste if both citations go away is necessary or not. Remember that when I played with this without first running RM8’s Merge Duplicate Citations tool I had no problems whatsoever and I was surprised when the problem appeared after running Merge Duplicate Citations. That’s because there is no way to tell just by looking at the citations if they are reused or not.

Even though there is a workaround, I still think it’s a terrible bug that needs to be fixed, both for duplicate child links and for duplicate citation links. Otherwise, the duplicate citation links in particular are very likely going to continue to bite users as long as RM8 and its successors are in existence - which hopefully will be for a very long time.

I might be missing something Jerry, but I think if a citation is used more than once, then it must be reused. Having said that, I can understand the problem that you’ve highlighted.

That’s not really they way it works. For example, suppose you have a citation for the Birth fact in RM8. Memorize the citation and Paste/Copy it to the Birth fact. The same citation now exists twice for the Birth fact but the citation has not been reused because it was pasted with the Copy option. At this point, you can delete the first instance of the citation and the second instance will remain. Or you can delete the second instance of the citation and the first instance will remain.

This exact scenario would obviously be a user error. You wouldn’t create the second instance of the same citation on purpose. And in this case, you can correct the error easily enough simply by deleting one of the citations.

The problem arises if you Memorize a citation for the Birth fact and Paste/Reuse the citation back into the same Birth fact rather than Paste/Copy. Now the citation really is reused and you have two instances of the same citation. My problem is that deleting either instance of the citation deletes both and I think doing so is a serious bug.

These are all contrived examples. My real example is that I have about a hundred duplicated citations in RM7 that are over 25 year old. If I import from RM7 into RM8, I need to run RM8’s Merge Duplicate Citations tool. Otherwise, citations that legitimately are used for different facts and for different people are not combined in reports as being duplicate endnotes. My old duplicated RM7 citations combined with importing RM7 into RM8 combined with running RM8’s Merge Duplicate Citations tool sets up the same scenario as doing a Memorize then a Paste/Reuse back into the same Birth fact. Namely, deleting one instance of a duplicated citation deletes both instances.

Thanks for raising this issue, Jerry. I ran into this problem last week and wondered about it. I haven’t checked this yet, but I wonder … if you reuse a citation in a different record and then delete from the original record, does it also get deleted in the second record? … Ron

No, the citation does not get deleted in the second record. That should answer your question, but I will make the mistake of trying to explain further.

Let’s use a death certificate as an example. Let’s let a death certificate be a citation both for the Death fact for the deceased and for the Burial fact for the same person. Using RM8’s reusable citations to their best advantage, you might create a citation for the death certificate that was linked to the Death fact. Then you could Memorize the citation and Paste/Reuse it to the Burial fact which has the effect of linking it to the Burial fact.

Now that our setup is done, we can delete the citation from the Death fact and it will still be linked to the Burial fact. Or we can delete the citation from the Burial fact and it will still be linked to the Death fact.

But how could the scenario I just described possibly work? After all, I first linked to the citation of the death certificate to the Death fact. Didn’t that make the citation “belong” to the Death fact so that if I then linked the citation to the Burial fact and then deleted the citation from the Death fact that the citation would just be gone from my database? And being gone from my database, wouldn’t it be gone now from both the Death fact and the Burial fact? The answer is no.

The reason the answer is no is that the citation never belonged to the Death fact in the first place. It was only linked to the Death fact. And after it was linked to the Burial fact, the citation was linked to both the Death fact and the Burial fact. You can’t even tell which fact it was linked to first because it doesn’t matter. And you can delete the citation from both the Death fact and from both the Burial fact and the citation is still in the database. You can still see it in the main Sources tab. If you chase it down at this point, you can see that it’s still there and that it’s used 0 times. Before deleting it from both the Death fact and Burial fact it was used 2 times.

Finally, you can actually create a new citation from the main Sources tab instead of from the Edit Person screen. Having done so, the citation will exist with a use count of 0. You can link the new citation to people, families, facts, and names without having to create the citation again. You link it where it needs to be by the Memorize and Paste mechanism.

So all of that its good. This discussion is about a different scenario. Suppose my death certificate gets linked to the same Death fact twice. That normally would be a user error, but things like import via GEDCOM or via TreeShare etc. can apparently create this kind of incorrect situation. My complaint is that if you do find yourself in the situation of having the same citation linked to the same Death fact twice, deleting one of the links also deletes the other link. And I think that behavior very clearly is a bug. If you highlight one link and then click the Delete icon, it should delete just that one link and not the other.

It’s as though the list of citations for a fact doesn’t know the record numbers of the CitationLinkTable, only those of the EventTable and CitationTable… so a Delete statement is only constrained by those values.

You should be able to tell if you have a reused or copied citation by looking at the Used list. Look for that same location and count the times it used there. Most likely the count will even be off if you’re looking at copies of the citation.

It is by design that removing duplicate reused links in the same location will remove all. You’ll find this with Addresses and Repositories too. All these duplicates links usually come from merging and the order it was done. I personally would much rather remove Ancestry as a Source repository once than do each one individually 100 times. Believe me I’ve seen these files.

A brilliantly succinct description of the problem. When you highlight a specific citation to delete, you are identifying a particular row in the CitationLinkTable that needs be deleted. It needs to delete that row and only that row, as identified by that row’s LinkID field. But instead, it’s deleting that row and any other rows that match that row’s CitationID, OwnerType, and OwnerID fields.

1 Like

I have finished my project to delete duplicate citations for the same fact in RM7. Therefore, I will no longer have the problem that deleting one instance of a duplicate citation for the same fact in RM8 will delete all the other duplicate instances of that citation for the same fact because my RM8 database will no longer have duplicate citations for the same fact after an import from RM7.

But having solved the problem for my database does not mean that I am any less unhappy with RM8’s behavior in this matter. I’m reminded of a couple of expressions, one expression probably familiar and one expression probably not. The familiar expression is surely universal to all parents: If all the other children jumped off the bridge, would you jump off the bridge, too? The fact that RM8’s Addresses and Repositories have jumped off this bridge doesn’t justify RM8’s Citations jumping off the same bridge. And I was chagrined to learn that even RM7 has the same sort of problem when a child who accidently is linked twice to the same family is unlinked just once and both links go away.

The other expression is from physics: it isn’t even wrong. This is expression is used when a published paper makes a claim that is considered so terribly wrong that the term “wrong” is not strong enough to express the degree of wrongness. To assert that 2 + 2 = 4 is right. To assert that 2 + 2 = 5 is wrong. To assert that 2 + 2 = 1000000 is not even wrong. The behavior of RM8 of deleting all duplicates in bulk and leaving none behind may be intentional, but it is so wrong that it isn’t even wrong. It doesn’t matter if the duplicates are parents, citations, addresses, or repositories. The principle is the same. Deleting one should not delete all.

As to Renee’s concern about being able to bulk delete if there are hundreds of such duplications, why not delete all but one of the duplicates as a single operation instead of deleting all of the duplicates? That’s a little harder to do, but it is doable. I was using SQLite to find all my duplicate citations for the same fact in RM7 and then I was doing the deletes by hand from the RM7 user interface. It was taking a long time, so I changed my SQLite script also to do the deletes and the deletes ran instantaneously. I designed my script so that it deleted all but one of the duplicates. It wasn’t really that hard to do.

I never used TMG but I still have this problem.

I’ve been following this same process when I find a duplicate…the first time though was quite a shock :slight_smile:
I don’t use TreeShare from Ancestry to RM.