2

I created a custom content type and provisioned it as a solution for SharePoint 2013 (PU March). When I create a new page in a list, bam yellow page of death.

To rule out an error I created a custom content type with the UI - inherits from article page with no additional fields. Then I added it to a document library. After assigning a name to the new page and submitting the form => yellow page of death with the following stack:

System.ArgumentException: Value does not fall within the expected range.
at Microsoft.SharePoint.Utilities.SPUtility.CreateParentFoldersForFile(SPList list, String url, Boolean createAsListItem)
at Microsoft.SharePoint.Publishing.Internal.CodeBehind.CreatePagePage.NewPageItemSave(String pageName, PageLayout pageLayout, String folderUrl, Boolean redirect)
at Microsoft.SharePoint.Publishing.Internal.CodeBehind.CreatePagePage.CreateStandardPage(String pageName)
at Microsoft.SharePoint.Publishing.Internal.CodeBehind.CreatePagePage.ButtonCreatePage_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Any clues?

Update1: When the parent of the content type is an article page it crashes. When the parent is a Basic Page it works.

2 Answers 2

1

First I think you mean by adding the content type to a page library. The ArgumentException could occur due to a invalid list. Here's what I would try:

  • Try it in a new subsite page library.
  • Add a custom content type to a custom page layout and create a page in a new subsite page library to see if you have the same problem
  • The error shows Publishing is involved. Try turn off publishing feature in a subsite and see if you are still having problem.
1

The function SPUtility.CreateParentFoldersForFile verfifies that the new item based on a publishing content type is stored in the Pages library. If not you get the error above.

Key takeaway: Publishing Content types only in the Publishing Library, aka. Pages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.