I recently came across a page that was giving me this error:
The control type '...' is not allowed on this page. The type is not registered as safe.
The obvious solution is to add a <SafeControl> tag to the web.config, but checking with my developer, he said it was not necessary and he does not have that declaration on his test server.
This led me to hypothesize that a custom branding we had was causing the problem to which my developer corroborated that unghosted master pages will cause problems.
So how to locate the unghosted pages? This led me to the following post: Ghosts in the Machine? However, this is for SharePoint 2007 so taking a leap of faith, I modified the SQL script provided and came up with this:
SELECT TOP 1000
[DirName]
,[LeafName]
,[SetupPath]
,[SetupPathUser]
FROM [WSS_Content].[dbo].[AllDocs]
where ([AllDocs].[Type] = 0)
AND ([AllDocs].SetupPath IS NOT NULL)
AND ([AllDocs].DocFlags & 64 = 64)
Checking the reference for the AllDocs Table this query seemed to make sense.
Learning how to do things and fix stuff as I go because who really has time to sit in a classroom. Posting it all here because I can not remember it all.
Showing posts with label master page. Show all posts
Showing posts with label master page. Show all posts
Monday, August 20, 2012
Wednesday, February 1, 2012
SPListItem provided is not compatible with a Publishing Page
I have been hitting my head against a wall lately with a custom master page and some custom sites. There appears to be an incompatibility between the 2. Since they come from separate sources, finding out where to point the finger is a little tricky. My custom master page makes use of Publishing, Feature Stapling, among other things.
The behaviour is that when I edit a community page and then click publish, it would throw an exception
System.ArgumentException: Invalid SPListItem. The SPListItem provided is not compatible with a Publishing Page.
at Microsoft.SharePoint.Publishing.PublishingPage.GetPublishingPage(SPListItem sourceListItem)
at Microsoft.SharePoint.Publishing.Internal.WebControls.PublishingPagePublishHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
I have yet to figure out what is going on here. However here are some other observations
$web = Get-SPWeb <SPWeb URL>
[Microsoft.SharePoint.Publishing.PublishingWeb]::IsPublishingWeb($web)
This returns false despite the Publishing tab being there and the SharePoint Server Publishing site feature is activated.
So, ignoring the False, I continue with this:
$publishingweb = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($web)
$publishingpages = $publishingweb.GetPublishingPages()
This throws an exception:
Exception calling "GetPublishingPages" with "0" argument(s): "The site is not valid. The 'Pages' document library is missing."
At line:1 char:53
+ $publishingpages = $publishingweb.GetPublishingPages <<<< ()
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
... but the Pages document library does indeed exist and I do have administrative rights on it.
I also try the following:
$pages = $web.Lists | Where-Object {$_.Title -eq "Pages"}
$page = $pages.Items | Where-Object {$_.Name -eq "default.aspx"}
[Microsoft.SharePoint.Publishing.PublishingPage]::IsPublishingPage($page)
... and get False which I would expect given the results from above. What doesn’t make sense is that this default.aspx page does have a Publish tab on it.
I then decided to try the IsPublishingWeb again, but without the custom master page. This is still giving me False. So, I guess I will start pointing the finger towards my custom site ...
The behaviour is that when I edit a community page and then click publish, it would throw an exception
System.ArgumentException: Invalid SPListItem. The SPListItem provided is not compatible with a Publishing Page.
at Microsoft.SharePoint.Publishing.PublishingPage.GetPublishingPage(SPListItem sourceListItem)
at Microsoft.SharePoint.Publishing.Internal.WebControls.PublishingPagePublishHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
I have yet to figure out what is going on here. However here are some other observations
$web = Get-SPWeb <SPWeb URL>
[Microsoft.SharePoint.Publishing.PublishingWeb]::IsPublishingWeb($web)
This returns false despite the Publishing tab being there and the SharePoint Server Publishing site feature is activated.
So, ignoring the False, I continue with this:
$publishingweb = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($web)
$publishingpages = $publishingweb.GetPublishingPages()
This throws an exception:
Exception calling "GetPublishingPages" with "0" argument(s): "The site is not valid. The 'Pages' document library is missing."
At line:1 char:53
+ $publishingpages = $publishingweb.GetPublishingPages <<<< ()
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
... but the Pages document library does indeed exist and I do have administrative rights on it.
I also try the following:
$pages = $web.Lists | Where-Object {$_.Title -eq "Pages"}
$page = $pages.Items | Where-Object {$_.Name -eq "default.aspx"}
[Microsoft.SharePoint.Publishing.PublishingPage]::IsPublishingPage($page)
... and get False which I would expect given the results from above. What doesn’t make sense is that this default.aspx page does have a Publish tab on it.
I then decided to try the IsPublishingWeb again, but without the custom master page. This is still giving me False. So, I guess I will start pointing the finger towards my custom site ...
Subscribe to:
Posts (Atom)