error "Sequence contains more than one element" when trying to view product
Hi,
I'm new to ucommerce, just installed it last week...
I'm just setting up the product definitions and get the following error when trying to open the product editor:
Sequence contains more than one element
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Sequence contains more than one element
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:
[InvalidOperationException: Sequence contains more than one element]
My environment: Windows 7 dev pc with IIS, the latest build of umbraco (4.8.1) and the latest version of ucommerce + demo shop, SQL 2008 R2 dev
My product definition has the following properties:
Color, new enum datatype, values "hell", "dunkel", "mittel" [also assigned to a different product definition, where it works without a problem]
Design, new enum datatype, values "Ahorn", "Buche", etc.
Type, new enum datatype, values "Landhausdiele 1-Stab", "Landhausdiele 2-Stab", etc. [also assigned to a different product definition, where it works without a problem]
PriceRange, new enum datatype, values "1 - 30 pro m²", "30 - 40 pro m²", etc. [also assigned to a different product definition, where it works without a problem]
Image, image
ShortInfo, richtext
TechnicalData, richtext
FurtherInfo, richtext
Tipps, richtext
InAdCampaign, bool
What I tried:
- initially I created the properties as "short text" and could open the created product
- afterward I changed them from short text to the enums and got the error
- after that, when changing the enums back to "short text" I also got the error
- I deleted all properties --> I could open the product editor
- then I deleted the product (maybe it had to be enums from the beginning - the product was created when there hadn't been any additional properties)
- I recreated the properties for the product definition (I saw that when I reused the same name, the deleted properties where used again by setting "deleted" to false in the table "ucommerce-productdefinitionfield"
Just found the problem - in table uCommerce_ProductDefinitionFieldDescription I had several items with duplicate rows for the localized product definition. After deleting the duplicate row manually from the database it worked. So that must have happened while I was defining the product properties. Couldn't say why though...
SELECT CultureCode, ProductDefinitionFieldId, COUNT(*) FROM uCommerce_ProductDefinitionFieldDescription GROUP BY CultureCode, ProductDefinitionFieldId having COUNT(*) > 1
error "Sequence contains more than one element" when trying to view product
Hi,
I'm new to ucommerce, just installed it last week...
I'm just setting up the product definitions and get the following error when trying to open the product editor:
Sequence contains more than one element
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Sequence contains more than one element
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:
[InvalidOperationException: Sequence contains more than one element]
NHibernate.Linq.NhQueryProvider.ExecuteQuery(NhLinqExpression nhLinqExpression, IQuery query, NhLinqExpression nhQuery) +128
NHibernate.Linq.NhQueryProvider.Execute(Expression expression) +84
System.Linq.Queryable.SingleOrDefault(IQueryable`1 source, Expression`1 predicate) +300
UCommerce.EntitiesV2.Repository`1.SingleOrDefault(Expression`1 expression) +82
UCommerce.EntitiesV2.ProductDefinitionField.GetDisplayName(ILocalizationContext localizationContext) +676
UCommerce.Web.UI.Umbraco.UCommerce.Controls.ProductDefinitionFieldDisplayName.DataBind() +56
System.Web.UI.Control.DataBindChildren() +201
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
System.Web.UI.Control.DataBind() +15
System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +127
System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +478
System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +61
System.Web.UI.WebControls.Repeater.DataBind() +76
System.Web.UI.Control.DataBindChildren() +201
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
UCommerceWeb.Umbraco.UCommerce.Catalog.EditProductDescription.DataBind() +20
System.Web.UI.Control.DataBindChildren() +201
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
System.Web.UI.Control.DataBind() +15
System.Web.UI.Control.DataBindChildren() +201
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
System.Web.UI.Control.DataBind() +15
UCommerce.Presentation.Web.Umbraco.TabViewBuilder.BuildTabView(TabView tabView, IView view, Boolean databindTabView, ImageClickEventHandler saveMethod, ImageClickEventHandler deleteMethod) +636
UCommerceWeb.Umbraco.UCommerce.Catalog.EditProduct.InitializeTabView(TabView tabView) +120
UCommerceWeb.Umbraco.UCommerce.MasterPages.UmbracoTabView.Page_Load(Object sender, EventArgs e) +64
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Control.LoadRecursive() +146
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
--------------------------------------------------------------------------------------------------
My environment: Windows 7 dev pc with IIS, the latest build of umbraco (4.8.1) and the latest version of ucommerce + demo shop, SQL 2008 R2 dev
My product definition has the following properties:
What I tried:
- initially I created the properties as "short text" and could open the created product
- afterward I changed them from short text to the enums and got the error
- after that, when changing the enums back to "short text" I also got the error
- I deleted all properties --> I could open the product editor
- then I deleted the product (maybe it had to be enums from the beginning - the product was created when there hadn't been any additional properties)
- I recreated the properties for the product definition (I saw that when I reused the same name, the deleted properties where used again by setting "deleted" to false in the table "ucommerce-productdefinitionfield"
- I created a new product and still got the error
Any ideas where I could look?
Thanks in advance,
Nina
Just found the problem - in table uCommerce_ProductDefinitionFieldDescription I had several items with duplicate rows for the localized product definition.
After deleting the duplicate row manually from the database it worked. So that must have happened while I was defining the product properties. Couldn't say why though...
SELECT CultureCode, ProductDefinitionFieldId, COUNT(*)
FROM uCommerce_ProductDefinitionFieldDescription
GROUP BY CultureCode, ProductDefinitionFieldId
having COUNT(*) > 1
Thanks for following up. I'll add a task to our Scrum board to get some contraints added.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.