0
votes

I am getting the below exception after we upgraded to Sitecore 8.2 and glass mapper version 4.3.4.197.

Exception : Message = "Failed to find configuration for parent item type Sitecore.Data.Items.Item"

My code below :

Saving item into master database

Parent Item type = Sitecore.Data.Items
var newItem = sitecoreContext.Create(parentItem , fixed);  
1

1 Answers

0
votes

I was having the same issue and found that if you cast your parent item to a specific template it seems to work. For example, instead of

Item parent = sitecoreService.GetItem<Item>(GUID); ChildTemplateType childItem = sitecoreService.Create(parent, childData);

use:

Item parent = sitecoreService.GetItem<Item>(GUID); ParentTemplateType parentCasted = sitecoreService.Cast<ParentTemplateType>(parent); ChildTemplateType childItem = sitecoreService.Create(parentCasted, childData);