Try our conversational search powered by Generative AI!

NullReferenceException efter added inventory on item

Vote:
 

Hi Episerver developers,

i get this exception that i can't wrap my head around and hopefully you can give me some ideas.

My product listing works and and shows the articles when i click on them until i add inventory to the item. 

Then it breaks when trying to go to the productdetail view from the list.

I get this exception and the breakpoint doesn't hit the productdetail controller.

Im running commerce 9.19.1

Any ideas would be much appritiated?!

[NullReferenceException: Object reference not set to an instance of an object.]
EPiServer.Commerce.Catalog.Provider.Construction.CatalogPropertyLoader.AddStockPlacementPropertyValues(VariationRow variationRow, IContent content) +569
EPiServer.Commerce.Catalog.Provider.Construction.CatalogPropertyLoader.LoadStaticContentProperties(CatalogEntryRow entryRow, CatalogItemSeoRow seoRow, VariationRow variationRow, EntryContentBase content) +155
EPiServer.Commerce.Catalog.Provider.Construction.CatalogPropertyLoader.LoadProperties(CatalogEntryRow entryRow, CatalogItemSeoRow seoRow, VariationRow variationRow, EntryContentBase content, MetaObjectAccessor metaObjectAccessor) +141
EPiServer.Commerce.Catalog.Provider.Construction.EntryBuilder.ConstructEntries(CatalogEntryDto entryDto, IDictionary`2 versionsForUnpublishedContent, IList`1 entryNodeRelations, String language) +708
EPiServer.Commerce.Catalog.Provider.Construction.EntryBuilder.Create(IList`1 contentLinks, String language) +638
EPiServer.Commerce.Catalog.Provider.<>c__DisplayClass13_0.<>LoadSpecificContentInstances>b__0(ICatalogContentBuilder builder, IList`1 links) +16
EPiServer.Commerce.Catalog.Provider.CatalogContentLoader.ConstructContent(IList`1 contentLinks, Func`3 createContentFunc) +339
EPiServer.Commerce.Catalog.Provider.CatalogContentLoader.LoadSpecificContentInstances(IList`1 contentLinks, String language) +453
EPiServer.Commerce.Catalog.Provider.<>c__DisplayClass28_0.b__0(IList`1 refs) +44
EPiServer.Commerce.Catalog.Provider.CatalogContentProvider.BatchLoad(IList`1 contentLinks, Func`2 dbLoader) +141
EPiServer.Commerce.Catalog.Provider.CatalogContentProvider.LoadContents(IList`1 contentReferences, ILanguageSelector selector) +425
EPiServer.Commerce.Catalog.Provider.CatalogContentProvider.LoadContent(ContentReference contentLink, ILanguageSelector languageSelector) +138
EPiServer.Core.<>c__DisplayClass115_0.<>LoadContentFromCacheOrRepository>b__0() +93
EPiServer.Core.OptimisticCache`1.Read(String cacheKey, ReadAndCacheObject`1 readAndCacheObject) +563
EPiServer.Core.ContentProvider.LoadContentFromCacheOrRepository(ContentReference contentreference, ILanguageSelector selector) +728
EPiServer.Core.DefaultContentLoader.GetBySegmentInternal(ContentProvider provider, ContentReference parentLink, String urlSegment, LoaderOptions loaderOptions) +352
EPiServer.Core.DefaultContentLoader.GetBySegment(ContentReference parentLink, String urlSegment, LoaderOptions selector) +56
EPiServer.Core.DefaultContentLoader.GetBySegment(ContentReference parentLink, String urlSegment, CultureInfo language) +99
EPiServer.Commerce.Routing.HierarchicalCatalogPartialRouter.FindNextContentInSegmentPair(CatalogContentBase catalogContent, SegmentPair segmentPair, SegmentContext segmentContext, CultureInfo cultureInfo) +304
EPiServer.Commerce.Routing.HierarchicalCatalogPartialRouter.GetCatalogContentRecursive(CatalogContentBase catalogContent, SegmentPair segmentPair, SegmentContext segmentContext, CultureInfo cultureInfo) +149
EPiServer.Commerce.Routing.HierarchicalCatalogPartialRouter.GetCatalogContentRecursive(CatalogContentBase catalogContent, SegmentPair segmentPair, SegmentContext segmentContext, CultureInfo cultureInfo) +371
EPiServer.Commerce.Routing.HierarchicalCatalogPartialRouter.GetCatalogContentRecursive(CatalogContentBase catalogContent, SegmentPair segmentPair, SegmentContext segmentContext, CultureInfo cultureInfo) +371
EPiServer.Commerce.Routing.HierarchicalCatalogPartialRouter.RoutePartial(PageData content, SegmentContext segmentContext) +307
EPiServer.Web.Routing.PartialRouter`2.RoutePartial(IContent content, SegmentContext segementContext) +119
EPiServer.Web.Routing.Segments.PartialSegment.RouteDataMatch(SegmentContext context) +272
EPiServer.Web.Routing.<>c__DisplayClass44_0.<>MatchSegments>b__0(ISegment s) +15
System.Linq.Enumerable.All(IEnumerable`1 source, Func`2 predicate) +146

#152671
Aug 29, 2016 0:20
Vote:
 

It's pretty strange - is your "product" a variation, or a product?

Does this happen on a specific "product", or all "products"?

How did you add the inventory information to it?

Regards,

/Q

#152678
Aug 29, 2016 9:36
Vote:
 

Hi Quan,

Thanx for your reply.

My product is a variation and i get the error only on the variation where i added stock.

The other variants work fine where i havent added stock.

Ive added stock both manually in commerce/catalog manager ui and as csv file import to be sure i havent missed any fields.

My solution is built on the epic photo starter kit on git.

Regards

/Peter

#152682
Aug 29, 2016 10:30
Vote:
 

Can you download this file https://www.dropbox.com/s/z8wr5ro3ixd4ivk/EPiServer.Business.Commerce.pdb?dl=0

and drop the EPiServer.Business.Commerce.pdb to your bin folder, and see which line causes the exception?

#152684
Edited, Aug 29, 2016 10:37
Vote:
 

Hi Quan,

Stupid question, do you want me to replace existing episerver.commerce.core nuget package with the one i downloaded from you?

when i search the nuget package i cant find any file named EPiServer.Commerce.Core.pdb.

Thanx for your help

/Peter

#153263
Aug 29, 2016 12:58
Vote:
 

Hi,

My bad, it's EPiServer.Business.Commerce.pdb

No, you don't have to replace it, you just need to copy EPiServer.Business.Commerce.pdb to your bin folder.

/Q

#153264
Aug 29, 2016 13:00
Vote:
 

Hi,

It was problems with the models.

Thanx for your help

/P

#155263
Sep 13, 2016 11:42
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.