Wrong URL in "Content" list in Dashboard after migrating to autoroute

Topics: Core, General, Troubleshooting
Feb 23, 2012 at 3:18 AM
Edited Feb 23, 2012 at 3:38 AM

Today I migrated my project to use the latest autoroute code in the 1.x branch. I didn't use the Updateto14 feature because my project has a bunch of recipes that rehydrate the entire db from scratch every time I do a new build. So I opted to add titlepart and AutoroutePart elements into my recipes and then try some new builds to see if I could get the conversion right.

However, for my 2nd recipe there is a slight glitch. When I go to "Content" page in the dashboard for the items in my 2nd recipe, a lot of them have the "View" URL as something like "my-url-prefix/-2", "my-url-prefix/-3", etc. They should look like: "my-url-prefix/item-name". Most do look correct in the Dashboard.

I checked the alias table and it looks like all items from this recipe have two alias records. The first record is the one with the .../-XX (where XX is some number in a sequence starting from 2 - 218). The second record for each item is one with the correct alias. I'm not sure what determines which of the two is used in the "View" link in the dashboard, but both aliases work to bring up the item in the front end. 

Feb 23, 2012 at 3:31 AM
Edited Feb 23, 2012 at 3:33 AM

EDIT: Actually, nm. Both recipes have the same issue. I just didn't notice the wrong URL's entered for the types in my 1st recipe. 

Re-ordering the tags in 2nd recipe didn't help. Every item I import seems to get two records in the alias table. And the dashboard sometimes shows the right one, sometimes the wrong one. All the aliases actually work in the front end. 

Here is how I attached the title and autoroute parts in Migrations.cs, in case it matters: 

 

                        .WithPart("TitlePart")
                        .WithPart(
                            "AutoroutePart"
                            , c =>
                                c.WithSetting("AutorouteSettings.PerItemConfiguration", "False")
                                .WithSetting("AutorouteSettings.AllowCustomPattern", "True")
                                .WithSetting("AutorouteSettings.AutomaticAdjustmentOnEdit", "False")
                                .WithSetting("AutorouteSettings.PatternDefinitions", @"[{""Name"":""Title"",""Pattern"":""my-guides/{Content.Slug}"",""Description"":""my-guides/sample-title""}]")
                                .WithSetting("AutorouteSettings.DefaultPatternIndex", "0")
                        )
Coordinator
Feb 23, 2012 at 4:42 AM

Please file a bug.

Feb 23, 2012 at 5:04 AM

Looks like someone already entered a bug for this: http://orchard.codeplex.com/workitem/18463