Not sure if this is a bug or a work in progress issue.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
Andrei and the team, i am not sure this issue is due to an unfinished work or it is really a bug.

it is in Change Set 54316 and has been there since the last 2 or 3 chagests as well.
the same thing happens as well when clicking on any category that displays products (categories with sub categories only work fine).

clicking on a product, causes an error as follows :



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: The 'Weight' property on 'ProductVariant' could not be set to a 'Double' value. You must set this property to a non-null value of type 'Decimal'.

Source Error:


Line 1811:            query = query.OrderBy(pv => pv.DisplayOrder);
Line 1812:            
Line 1813:            var productVariants = query.ToList();
Line 1814:
Line 1815:            if (ProductManager.CacheEnabled)


Source File: D:\Dev\nopCommerce\nopCommerce 1.70\Libraries\Nop.BusinessLogic\Products\ProductManager.cs    Line: 1813

Stack Trace:


[InvalidOperationException: The 'Weight' property on 'ProductVariant' could not be set to a 'Double' value. You must set this property to a non-null value of type 'Decimal'. ]
   System.Data.Common.Internal.Materialization.ErrorHandlingValueReader`1.GetValue(DbDataReader reader, Int32 ordinal) +312
   lambda_method(Closure , Shaper ) +6392
   System.Data.Common.Internal.Materialization.Shaper.HandleEntityAppendOnly(Func`2 constructEntityDelegate, EntityKey entityKey, EntitySet entitySet) +218
   lambda_method(Closure , Shaper ) +215
   System.Data.Common.Internal.Materialization.Coordinator`1.ReadNextElement(Shaper shaper) +170
   System.Data.Common.Internal.Materialization.SimpleEnumerator.MoveNext() +84
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +327
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +58
   NopSolutions.NopCommerce.BusinessLogic.Products.ProductManager.GetProductVariantsByProductId(Int32 productId, Boolean showHidden) in D:\Dev\nopCommerce\nopCommerce 1.70\Libraries\Nop.BusinessLogic\Products\ProductManager.cs:1813
   NopSolutions.NopCommerce.BusinessLogic.Products.ProductManager.GetProductVariantsByProductId(Int32 productId) in D:\Dev\nopCommerce\nopCommerce 1.70\Libraries\Nop.BusinessLogic\Products\ProductManager.cs:1779
   NopSolutions.NopCommerce.BusinessLogic.Products.Product.get_ProductVariants() in D:\Dev\nopCommerce\nopCommerce 1.70\Libraries\Nop.BusinessLogic\Products\Product.cs:328
   NopSolutions.NopCommerce.Web.Modules.ProductBox2Control.BindData() in D:\Dev\nopCommerce\nopCommerce 1.70\NopCommerceStore\Modules\ProductBox2.ascx.cs:78
   NopSolutions.NopCommerce.Web.Modules.ProductBox2Control.DataBind() in D:\Dev\nopCommerce\nopCommerce 1.70\NopCommerceStore\Modules\ProductBox2.ascx.cs:49
   System.Web.UI.Control.DataBindChildren() +201
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +101
   System.Web.UI.Control.DataBind() +15
   System.Web.UI.WebControls.ListView.CreateItemsWithoutGroups(ListViewPagedDataSource dataSource, Boolean dataBinding, InsertItemPosition insertPosition, ArrayList keyArray) +824
   System.Web.UI.WebControls.ListView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +1040
   System.Web.UI.WebControls.ListView.PerformDataBinding(IEnumerable data) +44
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +128
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +33
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +143
   System.Web.UI.WebControls.ListView.PerformSelect() +113
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74
   NopSolutions.NopCommerce.Web.Templates.Categories.ProductsInLines1.BindData() in D:\Dev\nopCommerce\nopCommerce 1.70\NopCommerceStore\Templates\Categories\ProductsInLines1.ascx.cs:160
   NopSolutions.NopCommerce.Web.Templates.Categories.ProductsInLines1.Page_Load(Object sender, EventArgs e) in D:\Dev\nopCommerce\nopCommerce 1.70\NopCommerceStore\Templates\Categories\ProductsInLines1.ascx.cs:48
   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.Control.LoadRecursive() +146
   System.Web.UI.Control.LoadRecursive() +146
   System.Web.UI.Control.LoadRecursive() +146
   System.Web.UI.Control.LoadRecursive() +146
   System.Web.UI.Control.LoadRecursive() +146
   System.Web.UI.Control.LoadRecursive() +146
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
13 years ago
SOLVED: Database type mismatch.

the Weight datatype is defined as Float in the database and as decimal in the Model and code.

Changing it from float to decimal in the db solves the issue.

thanks.
13 years ago
need a little help here with "The 'Weight' property on 'ProductVariant' could not be set to a 'Double' value. You must set this property to a non-null value of type 'Decimal'.

i switched from godaddy to softsys, they restored my db and i'm trying to install v1.7 but run into this error. i'm not familiar with the db, if someone could point me to the correct location in the db to change the "float" i would appreciate it.

fyi - godaddy db was sql server 2005 and softsys is 2008 (if that makes a difference).
13 years ago
there is a file upgrade.sql in the documents folder. run it against your db. it'll add and correct everything.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.