Possible "Add Combination' Bug (nop 3.7(

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 年 前
Nopcommerce 3.7

On our DEV server we are attempting a new product configuration. These are the steps that cause the error message:

Go to the "Product attributes" tab.
Go to the "Attribute combinations" tab.
Click "Add combination" and you should receive an internal error in the popup.

The error message in the log was:


"The model item passed into the dictionary is of type
'System.Collections.Generic.List`1[Nop.Admin.Models.Catalog.AddProductAttributeCombinationModel+ProductAttributeModel]', but this dictionary requires a model item of type 'System.Collections.Generic.IList`1[Nop.Web.Models.Catalog.ProductDetailsModel+ProductAttributeModel]'."


I am able to configure the product properly and "generate all combinations" works fine, but the error occurs when trying to add one manually.

Our attributes are

Size (with two options)
Sheets (using the conditions to apply to first size option)
Sheets (using the conditions to apply to second size option)

7 年 前
It works fine. Please provide a complete list of steps to reproduce the issue (screenshots of product attributes, values)
7 年 前
This error is occurring on multiple websites that are on 3.7. We've testing various attribute setups (ranging from basic to complex) and the same error is occurring:

Example: https://www.transferpaperexperts.com/Admin/Product/AddAttributeCombinationPopup?productId=105&btnId=btnRefreshCombinations&formId=product-form
7 年 前
Do you experience it on our demo site?
7 年 前
No, I do not get an error there. But isn't the demo site 3.8?
7 年 前
Right, it's 3.80. But it also worked fine in 3.70. I've just tested it in 3.70 locally one more time (it works fine).
7 年 前
All three sites that we have on 3.7 get this same error. It works fine for our two on 3.6.
7 年 前
DJ_Balogh wrote:
"The model item passed into the dictionary is of type
'System.Collections.Generic.List`1[Nop.Admin.Models.Catalog.AddProductAttributeCombinationModel+ProductAttributeModel]', but this dictionary requires a model item of type 'System.Collections.Generic.IList`1[Nop.Web.Models.Catalog.ProductDetailsModel+ProductAttributeModel]'."

According to your error a wrong view is being used (returned). Looks like \Nop.Web\Views\Product\_ProductAttributes.cshtml is returned instead of  Nop.Admin\Views\Product\_ProductAttributes.cshtml. Are you using any custom view engine (maybe, in plugins, etc)?

But as I've already written it works fine in both 3.70 and 3.80 out of the box
7 年 前
Okay, I appreciate your help. We're going to try it on a stock NopCommerce installation of 3.7 next.
7 年 前
The fix was to set the Build Action to Content, instead of None. It was set to none for the |Nop.Admin\Views\Product\_ProductAttributes.cshtml in our 3.7 projects and even the clean 3.7 install.

Which meant it wasn't in the dll when it was built via Jenkins

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.