Forum Discussion
Document template in an imported content type recently broken in SharePoint Online?
I am developing a solution where I have to create around 50 sites that are identical besides their names.
Each site will contain a document library with the same custom content type that has a custom document template.
I achieve(d) this by creating a content type on the "contentTypeHub", attaching a document template to the content type, and importing that content type to all the sites in the installation script and then adding that content type to the document library.
This worked fine and as expected up until a few weeks ago (up until about week 28).
I went on vacation for 4 weeks (weeks 28-32), did some other stuff for 2 weeks, and at the start of this week (week 34) I ran some test on the installation script (which had not been changed since it last worked) and now the document template cannot be found.
The content type, along with the document template, is still being imported to the new site and the document library, but if I try to create a new file with the document template SharePoint says that the file cannot be found. Installations before week 28, with the exact same script, still works fine. I'm getting the url of the template by fetching the content type and using the attribute "DocumentTemplateUrl" ($contentType = Get-PnPContentType -Identity $contentTypeId) which returns a relative url that cannot be reached.
Has something changed about the location of the document template?
4 Replies
- CallumCrowleyCopper ContributorI've reported this suspected bug here:
https://github.com/SharePoint/sp-dev-docs/issues/9171 - CallumCrowleyCopper Contributor
MattiasSundquist we're also experiencing this bug. Seems to affect content types that have document templates. Doesn't seem to matter whether the file is stored in the same site as the content type or if it's stored in another site.
- HOFH28Copper Contributor
I am experiencing the same problem.
It also happened suddenly a few weeks ago.In the Content type publishing log i see the following error (on all Content types)
[-2147024894] [System.IO.FileNotFoundException] [The system cannot find the file specified. (Exception from HRESULT: 0x80070002)]
- BVisser-PNBCopper Contributor
MattiasSundquist I seem to be experiencing similar behaviour when creating content-types at this moment. When trying to create a new document from a custom-contenttype configured with custom template, I'm getting an error in Word saying that the (template)document (that apparently supposed to be in the Forms directory according to the URL that is shown) cannot be found. Did you find a solution to your problem?