[NullReferenceException: Object reference not set to an instance of an object.]<
br
> Telerik.Sitefinity.Modules.GenericContent.ContentManager.IsContentBlockHtmlObsolete(String serverSideControlID, Guid pageId, ContentLifecycleStatus clcStatus, CultureInfo culture, String pageProviderName) +108<
> Telerik.Sitefinity.Modules.GenericContent.ContentManager.IsContentBlockHtmlObsolete(String serverSideControlID, Guid pageId, ContentLifecycleStatus clcStatus, CultureInfo culture) +49<
> Telerik.Sitefinity.Modules.GenericContent.ContentManager.IsContentBlockHtmlObsolete(String serverSideControlID, Guid pageId, ContentLifecycleStatus clcStatus) +94<
> Telerik.Sitefinity.Modules.GenericContent.Web.UI.ContentBlock.get_IsOutDated() +347<
> Telerik.Sitefinity.Modules.GenericContent.Web.UI.ContentBlock.get_CustomMessages() +315<
> Telerik.Sitefinity.Web.UI.ZoneEditor.CustomizeControlDockTitlebar(Control control, RadDock dock) +163<
> Telerik.Sitefinity.Web.UI.ZoneEditor.AddControlDocksToZone(String placeHolderId, Control zone) +167<
> Telerik.Sitefinity.Web.UI.ZoneEditor.ProcessPlaceholders() +131<
> Telerik.Sitefinity.Web.UI.ZoneEditor.CreateChildControls() +88<
> System.Web.UI.Control.EnsureChildControls() +181<
> System.Web.UI.Control.PreRenderRecursiveInternal() +59<
> System.Web.UI.Control.PreRenderRecursiveInternal() +221<
> System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4184
There is an issue with upgrade of content blocks in Page Templates. To fix this, please run the query below against your DB and check if the issue still exists. The script will fix the error and remove the option to share the content block while it is used in a template. NOTE: Backup your database before you run the script.
UPDATE
[sf_object_data]
SET
[sf_object_data].object_type =
'Telerik.Sitefinity.Modules.GenericContent.Web.UI.ContentBlockBase'
FROM
[sf_object_data] INNERJOIN[sf_page_templates]
ON
[sf_object_data].page_id = [sf_page_templates].id
WHEREobject_type =
'Telerik.Sitefinity.Modules.GenericContent.Web.UI.ContentBlock'
GO
WHEREoriginal_control_id
in
(
SELECT
[sf_object_data].id
)
AND
object_type =
This error occurs because of the new shared content block behaviour. It has been resolved in 4.1 SP1 that is due to be released today (Friday). Some of your ContentBlock controls have no IDs (the ID property is deleted). That breaks Page Editor. As a workaround, you could run the following code which will set unique IDs for all ContentBlocks: Again, use database backup if you are not intending to upgrade to the 4.1 SP1.
var manager = PageManager.GetManager();
var controlType =
typeof
(ContentBlock).FullName;
var propName =
"ID"
;
var controls = manager.GetControls<PageControl>().Where(pc => pc.ObjectType == controlType);
foreach
(var cb
controls)
var idProp = cb.Properties.FirstOrDefault(p => p.Name == propName);
if
(idProp ==
null
idProp = manager.CreateProperty();
idProp.Name = propName;
idProp.Value = Guid.NewGuid().ToString();
cb.Properties.Add(idProp);
var draftControls = manager.GetControls<PageDraftControl>().Where(pdc => pdc.ObjectType == controlType);
draftControls)
manager.SaveChanges();