Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Error after upgrading from 4.1 View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
adam - 10/21/2011 10:20:48 AM
   
Error after upgrading from 4.1
I've upgraded a site from 4.1 to 5 which uses portal templates and web parts.

in the CMSPages/PortalTemplate.aspx.cs i have custom code on the OnPreRender Event
thats errors

The custom code i have is


base.OnPreRender(e);

// Init the header tags
this.ltlTags.Text = this.HeaderTags;

// Google webamaster tools verify tag
this.ltlTags.Text += String.Format("<meta name=\"google-site-verification\" content=\"{0}\" />", Constants.GOOGLE_WEBMASTERTOOLSKEY);

CMS.TreeEngine.TreeNode tn = CMSContext.CurrentDocument;


This throws up the following error
Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).


and points to this line

CMS.TreeEngine.TreeNode tn = CMSContext.CurrentDocument;


i've tried using


CMS.TreeEngine.TreeProvider tp = new TreeProvider();
CMS.TreeEngine.TreeNode tn = tp.SelectSingleNode(CMSContext.CurrentSiteName, CMSContext.CurrentAliasPath, CMSContext.CurrentPageInfo.DocumentCulture);


but this gives the same error.

in the stack trace i have the following


[FormatException: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).]
System.Guid..ctor(String g) +2486
System.Data.Common.ObjectStorage.Set(Int32 recordNo, Object value) +217
System.Data.DataColumn.set_Item(Int32 record, Object value) +51

[ArgumentException: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).Couldn't store <Brand Story> in MenuItemTeaserImage Column. Expected type is Guid.]
System.Data.DataColumn.set_Item(Int32 record, Object value) +90
System.Data.DataRow.set_Item(DataColumn column, Object value) +296
System.Data.DataRow.set_Item(Int32 columnIndex, Object value) +27
CMS.TreeEngine.TreeNode.NewInstanceFromDataRow(DataRow dataRow, String className, TreeProvider existingTreeProvider) +611
CMS.TreeEngine.TreeNode..ctor(DataRow dataRow, String className, TreeProvider treeProvider) +133
CMS.TreeEngine.TreeProvider.SelectSingleNode(String siteName, String aliasPath, String cultureCode, Boolean combineWithDefaultCulture, String className, Boolean selectOnlyPublished, Boolean checkPermissions, Boolean selectCoupledData) +1437
CMS.TreeEngine.TreeProvider.SelectSingleNode(String siteName, String aliasPath, String cultureCode, Boolean combineWithDefaultCulture, String className, Boolean selectOnlyPublished, Boolean checkPermissions) +36
CMS.TreeEngine.TreeProvider.SelectSingleNode(String siteName, String aliasPath, String cultureCode, Boolean combineWithDefaultCulture, String className, Boolean selectOnlyPublished) +31
CMS.CMSHelper.CMSContext.get_CurrentDocument() +321
CMSPages_PortalTemplate.OnPreRender(EventArgs e) in c:\development\WelshWhisky\site\CMSPages\PortalTemplate.aspx.cs:45
System.Web.UI.Control.PreRenderRecursiveInternal() +80
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842


<Brand Story> in the stack trace is the name of my document.
i've checked the document type "Page (menu item)" and the MenuItemTeaserImage is set to allow null and it is null in the db. i've checked other kentico sites and they have the same db table structure with null in "MenuItemTeaserImage" column.

Anyone got any ideas or come across this before?

User avatar
Certified Developer v7
Certified  Developer v7
adam - 10/21/2011 10:41:18 AM
   
RE:Error after upgrading from 4.1
I'm also getting this error in the cms on

CMSModules\Content\CMSDesk\ContentEditFrameset.aspx.c

it seems like something to do with the MenuItemTeaserImage column

User avatar
Certified Developer v7
Certified  Developer v7
adam - 10/21/2011 11:00:13 AM
   
RE:Error after upgrading from 4.1
ok found the issue, the "View_CONTENT_MenuItem_Joined" had not updated correctly during the upgrade.