Developer forum

Forum » Development » Bug fix needed for image pattern

Bug fix needed for image pattern

Anders Ebdrup
Anders Ebdrup
Reply

Dear Dynamicweb,

 

Please see this thread: https://doc.dynamicweb.com/forum/ecommerce-standard-features/include-extension-in-imagepattern?PID=1605, where we urgent need a bug fix.

 

I have looked into the source code and have marked the issue with yellow below, as found images before the separator (;) are replaced by this line if nothing is found in the second iteration

                    List<string> foundImages = null;
                    bool isVariantImageFound = false;
                    foreach (TokenContainer tokenContainer in pattern.GetPatternTokens())
                    {
                        string imagePath = tokenContainer.PatternString;
                        imagePath = ReplaceTokensInImagePath(product, allSupportedPatternMappings, tokenContainer, imagePath);
                        foreach (var extender in extenders)
                            imagePath = extender.ReplaceImagePath(imagePath, product);
                        if (allFilePaths.TryGetValue(imagePath, out foundImages))
                        {
                            for (var i = 0; i < foundImages.Count; i++)
                            {
                                foreach (var extender in extenders)
                                    foundImages[i] = extender.ReplaceFilePath(imagePath, product);
                                if (!string.IsNullOrEmpty(foundImages[i]))
                                {
                                    foundImagePattern = tokenContainer.PatternString;
                                    if (foundImagePattern.Contains("VariantOption"))
                                    {
                                        isVariantImageFound = true;
                                    }

                                    break;
                                }
                            }
                        }
                    }

 

Can this be fixed in this week as we have a client going live Monday and are missing this feature??

 

Best regards,

Anders


Replies

 
Anders Ebdrup
Anders Ebdrup
Reply

This has now been fixed - please find this updated https://doc.dynamicweb.com/forum/ecommerce-standard-features/include-extension-in-imagepattern forum post

 

You must be logged in to post in the forum