Commit 27d9bfe
committed
Merge branch 'bugfix/compounding-relationships' into develop
Clear relationship list between `PersistRelations()` loops
With **OnTopic Library 4.0.0**, we introduced a `DataTable` for passing relationships to the `PersisRelations` stored procedure. To reduce the overhead of configuration, this `DataTable` is defined once, and reused for each relationship for a `Topic`.
Unfortunately, however, we weren't _`Clear()`ing_ that `DataTable` after each `Topic.Relationships` was saved. That likely means that if a topic had multiple relationships, then the relationships from each previous relationship were included in subsequent relationships. Ooops!!
We haven't _noticed_ any instances of that. And that's likely because we almost always only have one relationship on any given content type. The one exception to this is the `Related` and `RelatedContent` relationships which are part of the `Page` content type, and are used to associate related content to each page.
Fortunately, neither the `Related` or `RelatedContent` relationships are currently used—and they're the last relationships in by `RelationshipKey` name for all implementations of **OnTopic**. As a result, it's likely that this bug _only_ affected those relationships, and thus continued to go unnoticed.
Regardless, having this resolved will avoid potential confusion—or worse!—in the future if/when any implementors choose to add and use multiple relationships on any single content type descriptor.1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
689 | 689 | | |
690 | 690 | | |
691 | 691 | | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
692 | 695 | | |
693 | 696 | | |
694 | 697 | | |
| |||
0 commit comments