Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Enabled uploading document set default documents on no script sites #2550

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -550,27 +550,17 @@ private Microsoft.SharePoint.Client.ContentType CreateContentType(
}
}

if (!isNoScriptSite)
foreach (var doc in templateContentType.DocumentSetTemplate.DefaultDocuments)
{
foreach (var doc in templateContentType.DocumentSetTemplate.DefaultDocuments)
Microsoft.SharePoint.Client.ContentType ct = existingCTs.FirstOrDefault(c => c.StringId == doc.ContentTypeId);
if (ct != null)
{
Microsoft.SharePoint.Client.ContentType ct = existingCTs.FirstOrDefault(c => c.StringId == doc.ContentTypeId);
if (ct != null)
using (Stream fileStream = connector.GetFileStream(doc.FileSourcePath))
{
using (Stream fileStream = connector.GetFileStream(doc.FileSourcePath))
{
documentSetTemplate.DefaultDocuments.Add(doc.Name, ct.Id, ReadFullStream(fileStream));
}
documentSetTemplate.DefaultDocuments.Add(doc.Name, ct.Id, ReadFullStream(fileStream));
}
}
}
else
{
if (templateContentType.DocumentSetTemplate.DefaultDocuments.Any())
{
scope.LogWarning(CoreResources.Provisioning_ObjectHandlers_ContentTypes_SkipDocumentSetDefaultDocuments, name);
}
}

foreach (var sharedField in templateContentType.DocumentSetTemplate.SharedFields)
{
Expand Down