Hi, we disocvered a bug in the Ecommerce package.
After we upgraded a DW core from 9.4.5 to 9.4.7, we got some unexplainable errors. After a lot of testing we discovered the following. We downgraded the core to to 9.4.5 and started updating all individual packages. When we upgraded Dynamicweb.Ecommerce from version 1.4.12 to 1.4.13 the error re-appeared
The error is that if you have an Itemtype with an Item field of the type 'product', and you render this item in the frontend. You get an error, this only happens on the detail page of the item, the list rendering works fine.
(We loop through the products added to the item with: GetString("ItemPublisher:Item.RelatedProducts.Value");
The error we get when we upgrade the Dynamicweb Ecommerce package to 1.4.13 is:
Exception in template (Designs/Sitename/_parsed/Pagename.parsed.cshtml): System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object. at Dynamicweb.Ecommerce.Frontend.Renderer.RenderProduct(Product product, Boolean extendedProperties, Template template, Int32 loopCounter, Boolean renderRelated, String productUrl, Int32 quantity, Int32 wishListId, Boolean renderPublicList, Boolean isRecursiveCall, Lazy`1 categoryFieldSorting, Int32 orderLineOfProductCount) at Dynamicweb.Ecommerce.Content.Items.Editors.ProductEditor.RenderProducts(EditorRenderingContext context) at Dynamicweb.Ecommerce.Content.Items.Editors.ProductEditor.RenderValue(EditorRenderingContext context) at Dynamicweb.Content.Items.Rendering.Renderer.RenderItemField(ItemField field, Object value, Dictionary`2 validationErrors, Boolean allowEditing, Template template, String tagPrefix, ItemEntry itemEntry) at Dynamicweb.Content.Items.Rendering.Renderer.RenderItem(ItemEntry item, ItemSettings settings) at Dynamicweb.ItemPublisher.Frontend.Details(String itemId) at Dynamicweb.ItemPublisher.Frontend.GetContent() at Dynamicweb.ItemPublisher.Frontend.GetContentBySettings(String settings) --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Dynamicweb.Extensibility.AddIns.AddInManager.InvokeFunction(Object instance, String functionName, Object[] arguments) at Dynamicweb.Rendering.TemplateBase`1.RenderItemList(Object settings) at CompiledRazorTemplates.Dynamic.bcdfcffddbddfbefe.Execute() at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context) in c:\Users\abbottm\Documents\GitHub\RazorEngine\src\Core\RazorEngine.Core\Templating\TemplateBase.cs:line 126 at RazorEngine.Templating.TemplateService.Run(ITemplate template, DynamicViewBag viewBag) in c:\Users\abbottm\Documents\GitHub\RazorEngine\src\Core\RazorEngine.Core\Templating\TemplateService.cs:line 608 at RazorEngine.Templating.TemplateService.Parse(String razorTemplate, Object model, DynamicViewBag viewBag, String cacheName) in c:\Users\abbottm\Documents\GitHub\RazorEngine\src\Core\RazorEngine.Core\Templating\TemplateService.cs:line 439 at RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName) in c:\Users\abbottm\Documents\GitHub\RazorEngine\src\Core\RazorEngine.Core\Razor.cs:line 276 at Dynamicweb.Rendering.Template.RenderRazorTemplate()