Skip to content

Commit d50d389

Browse files
committed
In PersistRelations(), clear relationships DataTable each loop
This resolves a potential bug where related topics from a previous relationship might have been persisted to any subsequent relationships on the same `Topic`. This would only affect topics of a content type with multiple relationships on them. Fortunately, in the only cases we had of that, the secondary relationships a) weren't used any longer, and b) were the last relationship alphabetically. As such, this bug shouldn't have impacted any current implementations. Phew!
1 parent 913b68d commit d50d389

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

OnTopic.Data.Sql/SqlTopicRepository.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,9 @@ private static string PersistRelations(Topic topic, SqlConnection connection, bo
689689

690690
command.ExecuteNonQuery();
691691

692+
// Clear rows
693+
targetIds.Clear();
694+
692695
}
693696

694697
}

0 commit comments

Comments
 (0)