Developer forum

Forum » Development » Critical issue in assortments

Critical issue in assortments

Anders Ebdrup
Anders Ebdrup
Reply

Hi Dynamicweb,

 

We are testing with the latest version of DW (9.6.13) and see some issues with the assortments... Try the following:

  1. Access a product which is locked by an assortment with a direct link => the product is not displayed => CORRECT
  2. Access the same product with a user having access to the product => the product is displayed => CORRECT
  3. Now access the same product not logged in and without having access to the product => the product can now be displayed => NOT CORRECT

I think the issue is in this method:

        Public Function GetProductById(productId As String, productVariantId As String, productLanguageId As String, useAssortments As Boolean) As Product
            'Get from cache
            Dim cacheResult As ProductCacheResult = Nothing

            If Not String.IsNullOrWhiteSpace(productLanguageId) Then
                cacheResult = GetProductFromCache(productId, productLanguageId, productVariantId)
            End If
            If cacheResult Is Nothing Then
                cacheResult = GetProductFromCache(productId, Common.Context.LanguageID, productVariantId)
            End If

            If cacheResult.ProductMissingInCache.Any() Then
                Dim product As Product = Repository.GetProductById(productId, productVariantId, productLanguageId, useAssortments)

                If product Is Nothing AndAlso String.IsNullOrWhiteSpace(productLanguageId) AndAlso Functions.ShowUnTranslatedItems() AndAlso
                        Not productLanguageId.Equals(Application.DefaultLanguage.LanguageId, StringComparison.OrdinalIgnoreCase) Then
                    product = GetProductById(productId, productVariantId, Application.DefaultLanguage.LanguageId, useAssortments)
                End If

                AddProductToCache(product)

                Return product
            Else
                Return cacheResult.CachedProducts(0)
            End If
        End Function

 

Where the product is just returned if cached without checking access to the proper assortment.

 

Will you please try to look into this?

 

Best regards, Anders


Replies

 
Martin Vang
Martin Vang
Reply

Hi Anders,

I can see that this is a bug, just like you claim it is. Also, it has already been fixed for 9.7, but we forgot to merge it to 9.6.

I've created a bug for merging fix: Bug 67809: Assortments are not respected when using the API to fetch products because of caching

 

I'll make sure this thread is updated once it is released in a new Ecommerce package for 9.6.

BR

Martin

 
Martin Vang
Martin Vang
Reply

Released a Dynamicweb Ecommerce 1.6.59 - and will be part of the next hotfix.

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

Hi Anders

The Dynamicweb Ecommerce 1.6.59 are part of 9.6.14 and 9.7 releases

You are able to find these build in the download section:

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

Please contact Dynamicweb Support if you need any additional help regarding this.

Kind Regards
Dynamicweb Support
Kristian Kirkholt

Votes for this answer: 1

 

You must be logged in to post in the forum