Autoroute will not update alias

Topics: Customizing Orchard, Troubleshooting, Writing modules
Dec 31, 2014 at 11:53 AM
I have a Content type which is non draftable. This content will be updated by users in a specified role. Therefore I created a dedicated controller for this (copied functionality from Admin controller). Everything works except that Autoroute Alias is not updated after the pattern specified. Though Admin UI it works, but not through my customer controller.

Debugger shows that
  1. AutoroutePartHandler is constructed (and OnUpdated method is defined) in the main thread when saving item via Admin UI. So the AutorouteService.GenerateAlias is called then once.
  2. AutoroutePartHandler is constructed (and OnUpdated method is defined) NOT in the main thread when saving item via Front End UI. So the AutorouteService.GenerateAlias is NEVER called.
I failed to find out the reason for that. Is that a bug? Please help!!!
Coordinator
Dec 31, 2014 at 8:46 PM
Why didn't you use the built-in permission features in the first place, avoiding the (incomplete) copying of a large amount of code?
Jan 1, 2015 at 5:33 PM
Edited Jan 4, 2015 at 3:23 PM
The requirement of the project I am working at is that the content should be editable through main user UI, not the Admin UI. Users who will be editing content should make use of projections, grouping and filtering like other, non- editing users, do. So I do make use of the built in permission features but also have to expose editing functionality in the User UI which is not built in.

Rather then to change the core controller with built in editing methods I have made another one based on Admin controller, that's more secure and separates concerns better. I think I have gone in the right direction in my case, have I?

Anyway everything works great except that the Autoroute field is not updating itself when saving an item through User UI. I have coded a workaround which catches the field value from the Request.Form and puts it into the Autoroute part. But would be nice to hear from you on what is missing here or maybe it is a bug in Orchard. Your suggestions?