Developer forum

Forum » Dynamicweb 10 » GetProductGroup() missing from NavigationTreeNodeViewModelExtensions in 10.21.1

GetProductGroup() missing from NavigationTreeNodeViewModelExtensions in 10.21.1

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,
I have upgraded a local solution from DW 10.17 to DW10.21 and the menu started to display errors.
Specifically, the method GetProductGroup() is missing from NavigationTreeNodeViewModelExtensions.
It is used inside SwiftV2/Paragraph/Swift-v2_MenuRelatedContent/Menu.cshtml at line 23:

string GetGroupFieldValue(string fieldSystemName, NavigationTreeNodeViewModel node)
    {
        var productGroup = node.GetProductGroup();
        string fieldValue = string.Empty;
        if (productGroup.GroupFields is not null)
        {
            foreach (var field in productGroup.GroupFields)
            {
                if (field.SystemName == fieldSystemName)
                {
                    fieldValue = field.Value?.ToString() ?? string.Empty;
                }
            }
        }
        return fieldValue;
    }

 

Is this intended? Should I find a workaround or wait for a fix in the next version?

Thank you,
Adrian


Replies

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

The extension methods for NavigationTreeNodeViewModel are placed in multiple namespaces...

- General extension methods are placed in Dynamicweb.Frontend.Navigation.NavigationTreeNodeViewModelExtensions.

- Product related extension methods are placed in Dynamicweb.Ecommerce.ProductCatalog.NavigationTreeViewNodeExtensions - where GetProductGroup is found.

Maybe the template is missing a namespace reference at the top? It's there in the standard Menu.cshtml template in Swift v2, so it should be working.

@using Dynamicweb.Ecommerce.ProductCatalog

 If you can't make it work then please provide some more details about the errors that you get.

/Morten

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Morten,
In my test, I was using a standard Swift template. Maybe the Swift version was not updated.
When I downgraded the application, it worked without making any changes in the template. Therefore, something was changed in DW10.21.

Adrian

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Adrian

That extension method has not changed in 2 years - except the documentation that was updated in April of this year.

The NavigationTreeNodeViewModelExtensions was introduced in April 2025 and has never changed

So if downgrading works - that would be really odd...

If you run in a local project it can be implicit usings in your project.

BR Nicolai

 

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,
Something was weird indeed. I was using Standard Swift templates, no custom code. Tried a few recycles of the app before opening the thread. As soon as I downgraded, all worked without any template changes.
I have tried it again now, and it does work, with the same application (10.21.1)
It is very weird. I will keep testing, but if this has not changed in a long while, it obviously does not make sense to break.

Thank you for looking into it.

Adrian

 

 

You must be logged in to post in the forum