Developer forum

Forum » Ecommerce - Standard features » An error occurred while attaching module 'eCom_ProductCatalog' (Dynamicweb.Frontend.Content).

An error occurred while attaching module 'eCom_ProductCatalog' (Dynamicweb.Frontend.Content).

Kasper Legarth
Reply

Hi.

I'm experiences if you visit our customers product list page in the exact time a custom integration is getting products from BC the frontend throws an error, and there is no products. The paragraph that is failing is a swift_productcatalogapp, so the only thing in the template is: 

@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel>
 
@if (Pageview.IsVisualEditorMode) {
    <div class="alert alert-info" role="alert">
        <span>@Translate("Product catalog App: Edit this column to configure. (Product catalog app must be attached this paragraph)")</span>
    </div>
}
 
<div class="item_@Model.Item.SystemName.ToLower()">
@Model.GetModuleOutput()
</div>

S​o i don't see any way for me to prevent the error message frontend?

 

The complete error from the log:

2025-02-19 10:08:34.4066: An error occurred while attaching module 'eCom_ProductCatalog' (Dynamicweb.Frontend.Content). The url: https://scantruck.test.gotcha.dk/Default.aspx?ID=1761. System.NullReferenceException: Object reference not set to an instance of an object.
   at Dynamicweb.Ecommerce.Products.Categories.ProductCategoryFieldGroupValueService.GetOrderedInheritableParentIds(Group group, String defaultLanguageId)
   at Dynamicweb.Ecommerce.Products.Categories.ProductCategoryFieldGroupValueService.RecursivelySearchForFieldValues(Group group, String defaultLanguageId, List`1 categoryFields)
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at Dynamicweb.Ecommerce.Products.Categories.ProductCategoryFieldGroupValueService.GetGroupFieldValuesByLanguage(Group group, List`1 categoryFields, String languageId, Boolean isInheritedValue, Boolean searchRecursively)
   at Dynamicweb.Ecommerce.Products.Categories.ProductCategoryFieldGroupValueService.GetGroupCategoryFieldValues(IEnumerable`1 groups, List`1 fields, Boolean allowFallback)
   at Dynamicweb.Ecommerce.Products.Categories.ProductCategoryFieldGroupValueService.GetDefaultCategoryValuesFromGroups(IEnumerable`1 groupInfos, List`1 catFields)
   at Dynamicweb.Ecommerce.Products.Categories.ProductCategoryFieldGroupValueService.GetDefaultCategoryValueFromGroups(IEnumerable`1 groupInfos, Field catField)
   at Dynamicweb.Ecommerce.Products.Categories.ProductCategoryFieldValueService.GetProductCategoryFieldValue(Product product, String categoryId, Field field)
   at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.CreateView(ProductViewModelSettings settings, Product product, Field field)
   at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.GetFieldDisplayGroupValues(ProductViewModelSettings settings, Product product, String languageID, Lazy`1 productIds)
   at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.<>c__DisplayClass3_1.b__59()
   at Dynamicweb.Ecommerce.ProductCatalog.ViewModelPropertyFiller`1.Fill[S](T model, String propertyName, Func`1 source)
   at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.BulkCreateView(ProductViewModelSettings settings, Boolean isRecursive, IList`1 products)
   at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.<>c__DisplayClass23_0.b__0()
   at Dynamicweb.Ecommerce.ProductCatalog.ViewModelPropertyFiller`1.Fill[S](T model, String propertyName, Func`1 source)
   at Dynamicweb.Ecommerce.ProductCatalog.ViewEngine.CreateView(ProductListViewModelSettings settings, IList`1 products)
   at Dynamicweb.Ecommerce.ProductCatalog.ViewModelFactory.CreateView(ProductListViewModelSettings settings, IEnumerable`1 productAutoIds)
   at Dynamicweb.Ecommerce.ProductCatalog.ProductCatalogFrontend.RenderProductList(ProductCatalogSettings settings, QuerySettings querySettings, IQuery query, String groupId, Boolean feed)
   at Dynamicweb.Ecommerce.ProductCatalog.ProductCatalogFrontend.GetModuleContent()
   at Dynamicweb.Frontend.Content.GetModuleOutput(Paragraph paragraph, PageView pageview)
2025-02-19 10:08:34.4153: Request headers: [
  "Accept",
  "Accept-Encoding",
  "Accept-Language",
  "Cache-Control",
  "Connection",
  "Cookie",
  "Host",
  "Referer",
  "User-Agent",
  "sec-ch-ua",
  "sec-ch-ua-mobile",
  "sec-ch-ua-platform",
  "upgrade-insecure-requests",
  "sec-fetch-site",
  "sec-fetch-mode",
  "sec-fetch-user",
  "sec-fetch-dest",
  "priority"
]
2025-02-19 10:08:34.4158: Request item keys: [
  "DW_Current_ExecutionTable",
  "DWPAGEVIEW",
  "TemplateContext",
  "EcomCart:CustomCartContext",
  "alternateUrlKey",
  "Product.UnitStock.62976...",
  "Price.000501191..LANG1..DKK.DK.SHOP2.0.",
  "InformativePrice.000501191..LANG1..DKK.DK.SHOP2.0.",
  "Product.UnitStock.64317...",
  "Price.000123242..LANG1..DKK.DK.SHOP2.0.",
  "InformativePrice.000123242..LANG1..DKK.DK.SHOP2.0.",
  "Product.UnitStock.62973...",
  "Price.000123236..LANG1..DKK.DK.SHOP2.0.",
  "InformativePrice.000123236..LANG1..DKK.DK.SHOP2.0.",
  "Product.UnitStock.62970...",
  "Price.000123234..LANG1..DKK.DK.SHOP2.0.",
  "InformativePrice.000123234..LANG1..DKK.DK.SHOP2.0.",
  "Product.UnitStock.62967...",
  "Price.000123224..LANG1..DKK.DK.SHOP2.0.",
  "InformativePrice.000123224..LANG1..DKK.DK.SHOP2.0.",
  "Product.UnitStock.62964...",
  "Price.000123223..LANG1..DKK.DK.SHOP2.0.",
  "InformativePrice.000123223..LANG1..DKK.DK.SHOP2.0.",
  "Product.UnitStock.64341...",
  "Price.000123212..LANG1..DKK.DK.SHOP2.0.",
  "InformativePrice.000123212..LANG1..DKK.DK.SHOP2.0.",
  "Product.UnitStock.64275...",
  "Price.000123114..LANG1..DKK.DK.SHOP2.0.",
  "InformativePrice.000123114..LANG1..DKK.DK.SHOP2.0.",
  "Product.UnitStock.62961...",
  "Price.000123108..LANG1..DKK.DK.SHOP2.0.",
  "InformativePrice.000123108..LANG1..DKK.DK.SHOP2.0.",
  "Product.UnitStock.64321...",
  "Price.000123106..LANG1..DKK.DK.SHOP2.0.",
  "InformativePrice.000123106..LANG1..DKK.DK.SHOP2.0.",
  "Product.UnitStock.62958...",
  "Price.000123105..LANG1..DKK.DK.SHOP2.0.",
  "InformativePrice.000123105..LANG1..DKK.DK.SHOP2.0.",
  "Product.UnitStock.64308...",
  "Price.000123092..LANG1..DKK.DK.SHOP2.0.",
  "InformativePrice.000123092..LANG1..DKK.DK.SHOP2.0.",
  "Product.UnitStock.62955...",
  "Price.000123090..LANG1..DKK.DK.SHOP2.0.",
  "InformativePrice.000123090..LANG1..DKK.DK.SHOP2.0.",
  "Product.UnitStock.62952...",
  "Price.000123073..LANG1..DKK.DK.SHOP2.0.",
  "InformativePrice.000123073..LANG1..DKK.DK.SHOP2.0."
]
2025-02-19 10:08:34.4161: Request form: []

Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

I have created 23234 to address the imediate issue of missing null check when retrieving inherited product field values.

 
Kasper Legarth
Reply

Hi Nicolai.

Thank you for your quick reply. 
Would it be possible for us to make a temporary fix while waiting for the bug fix?

 

You must be logged in to post in the forum