Simplifies the includeAllVersions check
This commit is contained in:
@@ -998,29 +998,15 @@ ORDER BY doc2.updateDate DESC
|
||||
contentTypes[dto.ContentVersionDto.ContentDto.ContentTypeId] = contentType;
|
||||
}
|
||||
|
||||
if (includeAllVersions)
|
||||
// track the definition and if it's successfully added or updated then processed
|
||||
if (defs.AddOrUpdate(new DocumentDefinition(dto, contentType)))
|
||||
{
|
||||
// track the definition
|
||||
defs.Add(new DocumentDefinition(dto, contentType));
|
||||
|
||||
// assign template
|
||||
if (dto.TemplateId.HasValue && dto.TemplateId.Value > 0)
|
||||
templateIds.Add(dto.TemplateId.Value);
|
||||
|
||||
content.Add(ContentFactory.BuildEntity(dto, contentType, publishedDto));
|
||||
}
|
||||
else
|
||||
{
|
||||
// track the definition and if it's successfully added or updated then processed
|
||||
if (defs.AddOrUpdate(new DocumentDefinition(dto, contentType)))
|
||||
{
|
||||
// assign template
|
||||
if (dto.TemplateId.HasValue && dto.TemplateId.Value > 0)
|
||||
templateIds.Add(dto.TemplateId.Value);
|
||||
|
||||
content.Add(ContentFactory.BuildEntity(dto, contentType, publishedDto));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// load all required templates in 1 query
|
||||
|
||||
@@ -812,6 +812,13 @@ ORDER BY contentNodeId, propertytypeid
|
||||
/// <returns></returns>
|
||||
public bool AddOrUpdate(DocumentDefinition item)
|
||||
{
|
||||
//if we are including all versions then just add, we aren't checking for latest
|
||||
if (_includeAllVersions)
|
||||
{
|
||||
base.Add(item);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Dictionary == null)
|
||||
{
|
||||
base.Add(item);
|
||||
|
||||
Reference in New Issue
Block a user