Issue with newly submitted patch

Feb 4, 2011 at 4:34 PM

Hi, I submitted a patch earlier and just want to warn of a bug in it.

The newly added extensibility point AttributesToRouteValues is fine but the change to ProcessXmlNodes was added a bit hastily and is causing some problems that were missed. The new method is the main point of the patch and will work fine with the other change removed.

Feb 4, 2011 at 5:19 PM

Sorry again but another update on this.

The bug wasn't in my patch but one hidden in the DefaultNodeKeyGenerator. I added the parentNode override at the same time as I made some other changes to my own sitemap, this interacted with the bug in the DefaultNodeKeyGenerator which resulted in a problem with similarly named actions across areas, as my change was designed to override parent nodes I attributed it to this.

The problem is that the GenerateKey method uses null coalescing on the url and area, but it was being passed an empty url and area (the latter may have been due to me explicitly giving a blank area attribute in the XML while bug hunting though this is also something I can imagine people doing this for the sake of being more explicit in their configuration). This meant that the first part of the key was always empty regardless of if it was given an area. This meant that when 2 nodes that are identical apart from area are passed in they get the same key.  I'm submitting a patch for this now.

Feb 5, 2011 at 2:27 PM

Thanks for both patches!