Developer forum

Forum » Ecommerce - Standard features » Bug in Dynamicweb.Ecommerce versions after 1.4.12 (Items with Products are broken)

Bug in Dynamicweb.Ecommerce versions after 1.4.12 (Items with Products are broken)

Harald Brouwers
Reply

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()

Replies

 
Oleg Rodionov Dynamicweb Employee
Oleg Rodionov
Reply

Hi Harald,

I've tested item publisher with default templates and could catch the exception when TemplateTags is enabled in details only (the same exception occurs within ItemPublisher:Items.List as well). It seems to be known issue risen by another topic and already bugged by TFS 48425. I've added description of your case into the bug. Thanks.

BR, Oleg QA 

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

FYI, I am getting the same error during checkout, when the email confirmation is rendered. See attached.

Image_275.png
 
Oleg Rodionov Dynamicweb Employee
Oleg Rodionov
Reply

HI Imar,

I was not able to catch the exeption on last DW94 - cart steps (product, discout and tax orderlines), notifications and checkout (Stripe was checked). The both - customer and site emails were enabled.

BR, Oleg QA

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

What if you add TemplateTags to the template? Maybe it's the same issue and only occurs when outputting specific fields? I believe you have this site (Lorenz) for another bug repro so maybe it reproduces there still when the site gets upgraded?

 
Harald Brouwers
Reply

Hi Oleg,

Thank you for your reply. Can you tell me in which release this bug will be fixed? I couldn't find TFS 48425 on the bugs page.

Greetings Harald

 
Kristian Kirkholt Dynamicweb Employee
Kristian Kirkholt
Reply
This post has been marked as an answer

Hi Harald

The TFS 48425 has now been resolved in Dynamicweb version 9.4.8

To upgrade please choose this version from download here:

http://doc.dynamicweb.com/releases-and-downloads/releases

Let me know if you need any more help regarding this

Kind Regards
Dynamicweb Support
Kristian Kirkholt

Votes for this answer: 1

 

You must be logged in to post in the forum