This project is read-only.

Route not picked up by alias or autoroute...autoroute bug?

Topics: Core, Troubleshooting, Writing modules
May 22, 2012 at 10:07 AM
Edited May 22, 2012 at 10:11 AM

I have a route (the url "/members") to a custom controller which worked in 1.3 but now in 1.4.1 it doesn't and shows me a error 500.

I've changed the priority to 100/500/1000 but nothing seems to works. The route url matches the content item url so i think that's the problem. I've the changed the content item url to something other then "/members" but because it's still in the database it's still get overridden by it. When i change the url of the route to something like /members2 it works but i really want to just use /members.

Is this is a know bug and is there a workaround?

May 22, 2012 at 5:47 PM

Put a lower priority, try -99 for instance. Not sure it will work though, if it doesn't I will dig further.

May 22, 2012 at 6:04 PM

Good idea but that doesnt' work either. I've tried -99,-999, 0, 100,500,999 but none of them seems to work.

May 22, 2012 at 6:14 PM

Can you change the one in the database then as you don't seem to care about this one ?

May 23, 2012 at 8:53 AM
Edited May 23, 2012 at 3:43 PM

ok i've removed the corresponding records from the tables Orchard_Alias_AliasRecord and Orchard_Autoroute_AutoroutePartRecord but unfortunately it still doesnt' work. I there some other table i have to check? Still when i rename the route to something like /members2 it does work but /members doesn't. Any suggestions?

also where does the following message come from?:


Server Error;

I have disabled custom errors for sure and also vandelay industries module just to be sure.


Ok i think i've found something interesting. Ive started a new tenant with the same code to find out if it was something in db or code. I haven't activated alle modules and features but now i receive the following exception:

A tenant could not be started: test
System.ArgumentException: A route named 'MyCustomRouteName' is already in the route collection. Route names must be unique.

Because of this error i suspect that the routes are loaded twice because of a feature naming problems. The strange thing is that this always worked till i upgraded to 1.4 and above. Or could this behavior has something to to with the multitenant which i created to test my problem

May 25, 2012 at 9:22 AM

Update: I've created a whole new database and create a new Orchard site with the same code. It's a total clean setup without any create content. I almost seems like the word /members is forbidden because the only route that doesn't seems to work is members. When i change it to members2 or anything like that is working but members won't. I've searched the total solution folder (file search not solution project search) for the words members but can't find anything which could be messing up this route. Does anybody has a suggestion because i have spend already to many hours on this problem. Many thanks!

May 25, 2012 at 10:45 AM
Edited May 25, 2012 at 11:11 AM

Fixed update: Lol this was on of the most easiest but also confusing problems i've seen. Within my visual studio i copied my http://mywebsitename/members as a projecturl in visual studio and pushed Create Virtual Directory of course i saw that this was wrong i changed it and pushed once again on create virual directory it i thought i was done. The problem was of course that the earlier created virtual directory was still there but pointing to an other older IIS website with an older version of my website. So in fact there was no Orchard bug whatsoever. Learned a lot of the routing core of Orchard because of this problem by diving in the code! :)

Thanks you guys!

May 25, 2012 at 6:42 PM

One less to worry about, thanks for explaining there were no issue here.