Added fix for RelateOnTrashComponent.MediaService_Trashed so relations are looked up before creating duplicates
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
This commit is contained in:
@@ -543,6 +543,18 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public IRelation GetByParentChildAndType(int parentId, int childId, IRelationType relationType)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope(autoComplete: true))
|
||||
{
|
||||
var query = Query<IRelation>().Where(x => x.ParentId == parentId &&
|
||||
x.ChildId == childId &&
|
||||
x.RelationTypeId == relationType.Id);
|
||||
return _relationRepository.Get(query).FirstOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private IRelationType GetRelationType(string relationTypeAlias)
|
||||
|
||||
Reference in New Issue
Block a user