A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
AI OnAI Off
A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
You probably need to use IsPrimary like in the below code snippt
var nodeRelations = _relationRepository.GetParents<NodeEntryRelation>(entryContentReference).ToList();
var primaryRelation = nodeRelations.FirstOrDefault(x => x.IsPrimary);
if (primaryRelation != null)
{
var thisRelationContentReference = _referenceConverter.GetContentLink(primaryRelation.Parent.ID, CatalogContentType.CatalogNode, primaryRelation.Parent.WorkID);
var nodeContentBase = _contentLoader.Get<NodeContentBase>(thisRelationContentReference);
return nodeContentBase.ContentLink;
}
Hi there,
I have the following catalog three:
When I call _relationRepository.GetParents<NodeRelation>(reference-to-shorts-category).ToList() I was expecting to get a reference to "Men" category since it's the parent and primary category of "Shorts", but it returns a reference to "Pyjama" which is an additional category. Is that correct? Am I doing anything wrong?
Thank you in advance!