In your model class, or pagetype, what is the return type of the property. It should look something like this
public virtual XhtmlString MainBody{get;set;} Is that what you have for your property
For me this is a upgrade site
[Display(Name = "Main Body", GroupName = SystemTabNames.Content, Order = 3)]
public virtual XhtmlString MainBody{get;set;}
This is how I define a mainbody with xhtmlstring, the same as you Joshua.
These in an issue with a custom table in the DDS that holds the information about the settings for the Tiny MCE editor that may happen when upgrading to EPiServer CMS 7. The support team has a fix for this so please open a support case to get hold of this.
adding the bug number for references:
Bug #91274: [Upgrade] Can't open edit mode of Home page ( OPE and Form Editing)
Linus: Why can't you just post the fix here? I'm guessing it's just some SQL script that corrects the problem?
<%@ Page Language="C#" AutoEventWireup="False" Inherits="System.Web.UI.Page" %>
<%@ Import Namespace="System.Linq" %>
<%@ Import Namespace="EPiServer.Data.Dynamic" %>
<%@ Import Namespace="System.Reflection" %>
<!DOCTYPE html>
<script runat="server">
class StoreInfo
{
public string TableName;
public Type Type;
}
public void UpgradeFix(object sender, EventArgs e)
{
// A dictionary of DDS store name to Type/TableName
var remappings = new Dictionary<string, StoreInfo>();
// Get all types from the app domain that has a specific DDS table configured.
foreach(Type t in AppDomain.CurrentDomain.GetAssemblies()
.SelectMany(a => a.GetTypes())
.Where(a => Attribute.IsDefined(a, typeof(EPiServerDataTableAttribute))))
{
var tableAttributes = (EPiServerDataTableAttribute[])t.GetCustomAttributes(typeof(EPiServerDataTableAttribute), false);
var storeAttributes = (EPiServerDataStoreAttribute[])t.GetCustomAttributes(typeof(EPiServerDataStoreAttribute), false);
foreach(var attrib in tableAttributes)
{
// Any configured store name or the type name
string storeName = (storeAttributes.FirstOrDefault() != null ? storeAttributes.FirstOrDefault().StoreName : null) ?? t.FullName;
remappings.Add(storeName, new StoreInfo
{
TableName = attrib.TableName,
Type = t
});
}
}
var instance = EPiServer.Data.Dynamic.Providers.DataStoreProvider.CreateInstance();
foreach (var definition in StoreDefinition.GetAll())
{
StoreInfo mapping;
if (remappings.TryGetValue(definition.StoreName, out mapping))
{
Response.Write("Remapping: " + definition.StoreName + "<br/>");
// Save each definition type that has a specific table definition and explicitly set the tableName,
// since this fails for types without primitive properties
definition.GetType().GetProperty("TableName").SetValue(definition, mapping.TableName, null);
instance.SaveStoreDefinition(definition);
}
}
}
//public void UpgradeRemap(object sender, EventArgs e)
//{
// // What the Upgrade script does
// var instance = EPiServer.Data.Dynamic.Providers.DataStoreProvider.CreateInstance();
// foreach (var definition in EPiServer.Data.Dynamic.StoreDefinition.GetAll())
// {
// instance.SaveStoreDefinition(definition);
// }
//}
</script>
<html>
<body>
<form runat="server">
<p>Remember to back up your database before running this patch</p>
<asp:Button runat="server" Text="Upgrade Fix" OnClick="UpgradeFix" />
</form>
</body>
</html>
Thanks! Tried it and got this result:
Remapping: BackgroundJobStore
Remapping: DashboardContainerStore
Remapping: DashboardLayoutPartStore
Remapping: DashboardStore
Remapping: DashboardTabLayoutStore
Remapping: DashboardTabStore
Remapping: EPiServer.ApplicationModules.Security.SiteSecret
Remapping: EPiServer.Core.PropertySettings.PropertySettingsContainer
Remapping: EPiServer.Core.PropertySettings.PropertySettingsGlobals
Remapping: EPiServer.Core.PropertySettings.PropertySettingsWrapper
Remapping: EPiServer.Editor.TinyMCE.TinyMCESettings
Remapping: EPiServer.Editor.TinyMCE.ToolbarRow
Remapping: EPiServer.MirroringService.MirroringData
Remapping: EPiServer.Packaging.Storage.ApiKeyEntity
Remapping: EPiServer.Packaging.Storage.PackageEntity
Remapping: EPiServer.Packaging.Storage.StorageUpdateEntity
Remapping: EPiServer.Shell.Profile.ProfileData
Remapping: EPiServer.Shell.Storage.PersonalizedViewSettingsStorage
Remapping: GadgetStore
Remapping: VisitorGroup
Remapping: VisitorGroupsStatisticsSettingsStore
Remapping: XFormFolders
Remapping: XFormsViewerSettingsStore
But trying to open one of the settings (ui/cms/Admin/EditPageTypeGlobalSettings.aspx?value=ec8d4e3f-7f43-4831-af04-b85810552a4d) still gives me the error below. I'm running Patch 1, maybe that's part of the problem?
[NullReferenceException: Object reference not set to an instance of an object.] EPiServer.Editor.TinyMCE.InputTinyOptions.GetActiveToolsHTML() +168 EPiServer.Editor.TinyMCE.InputTinyOptions.AddTinyButtonsControl() +92 EPiServer.Editor.TinyMCE.InputTinyOptions.OnPreRender(EventArgs e) +22 System.Web.UI.Control.PreRenderRecursiveInternal() +83
Is this still a problem?
The script Linus supplied should've fixed this issue. At least judging from your call stack and the information at hand.
The script made it worse. All settings then caused the crash. I had to create new global settings and went with them.
Hi,
I'm experiencing an NullReferenceException when I'm trying to edit a page which contains a field with "XHTML String (>255)".
Below is the complete stack trace:
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
Anybody encountered this problem?