Developer forum

Forum » Development » Navigation ProcessTree override is ignored in 9.6.7

Navigation ProcessTree override is ignored in 9.6.7

Kim Søjborg Pedersen
Reply

Hi,
Ater upgrading to 9.6.7 my override ProcessTree is no longer executed. 

My code has run for a long period and is build like the example here https://doc.dynamicweb.com/api/html/23c6c4ec-0320-a8a7-0d56-2795771b546b.htm 

But after upgrading from 9.3.12 to the latest 9.6.7. my public override void ProcessTree(RootNavigationItem rootNode, XmlNavigation.NavigationType navigationType) is ignored, I have a breakpoint just before the ProcessTree a its hit, but the ProcessTree method is never hit or executed.

public class MenuProvider : NavigationProvider
    {
        string test = string.Empty; //TEST BREAKPOINT IS HIT

        public override void ProcessTree(RootNavigationItem rootNode, XmlNavigation.NavigationType navigationType) //THIS IS IGNORED 
        {
            HttpRequest request = HttpContext.Current.Request;

            foreach (NavigationItem node in rootNode.ChildNodes)

What has changed in Dynamicweb.Frontend.NavigationProviders ?

BR
Kim


Replies

 
Kim Søjborg Pedersen
Reply

I rolled back to 9.6.6 and now everything works as exspected.

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

Hi Kim,

In 9.6.7, we've refactored the standard navigation provider internally and simplified some of the logic that determines which provider to load. There shouldn't be any change of behavior for custom providers.

I've tried to reproduce your issue without success. I created a custom navigation provider and selected it on a page on a 9.6.6 solution, then upgraded the solution to 9.6.7. My navigation provider gets executed as expected. If you look at the navigation settings for the page, which provider, if any, is selected? Which navigation settings do you have selected under Settings -> Ecommerce -> Advanced configuration -> General -> Navigation? Does is work if you save the page settings?

To diagnose the issue further, I need to either try this again with your code or a copy of the solution that I can use to debug. You can send it directly to me, if you prefer not to post it on the forum.

- Jeppe

 
Kim Søjborg Pedersen
Reply

Hi Jeppe
Thanks for looking into this.

Q: If you look at the navigation settings for the page, which provider, if any, is selected?
A: None, it's set to default

Q: Which navigation settings do you have selected under Settings -> Ecommerce -> Advanced configuration -> General -> Navigation?
A: Only "Add product count to each group" is selected

Q: Does is work if you save the page settings?
A: I will try this and return with the result

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply
This post has been marked as an answer

Hi Kim,

If you want to use a custom navigation provider, you need to select it on the page. If the dropdown is set to "Standard" then the standard navigation provider gets executed. Try selecting your navigation provider on the page and save it. Your provider will be used instead of the standard one.

The dropdown will only appear if Dynamicweb sees a custom navigation provider type. If you don't see a dropdown, then there is no custom navigation provider for DW to load. Try adding your assembly to the bin folder again in this case.

- Jeppe

Votes for this answer: 1
 
Kim Søjborg Pedersen
Reply

Hi Jeppe
That makes sense, but I have never noticed the select as it worked fine with default in 9.6.6

/Kim

 

You must be logged in to post in the forum