U4-2279 - TryGetRouteDefinitionFromAncestorViewContexts has infinite loop when currentContext doesnt contain umbraco-route-def

Created by Robert Foster 28 May 2013, 08:39:37 Updated by Sebastiaan Janssen 29 May 2013, 05:44:32

If I do an ajax callback from an ActionResult view in a controller inheriting from SurfaceController and try to reference CurrentPage, I end up with an infinite loop due to ControllerContext not containing the expected RouteData key.

Fix is to change

currentRouteData = null; to

currentContext = null;

on line 117 in http://umbraco.codeplex.com/SourceControl/latest#src/Umbraco.Web/Mvc/SurfaceController.cs

Comments

Robert Foster 28 May 2013, 08:53:21

OT: really need a way for the umbraco-route-def to be present when using ajax callbacks on forms in action views...


Shannon Deminick 29 May 2013, 00:18:32

Thanks Robert! Are you able to further explain this "really need a way for the umbraco-route-def to be present when using ajax callbacks on forms in action views" ?


Shannon Deminick 29 May 2013, 00:19:42

Are you saying that you'd like 'CurrentPage' available when making an ajax call ? If that is the case, that is not really possible. You should just pass in the current Id up to your ajax action and then look it up with the UmbracoHelper in your action.


Robert Foster 29 May 2013, 01:15:32

Hey Shannon, Yeah, I ended up doing that... /Rob


Priority: Normal

Type: Bug

State: Fixed

Assignee: Shannon Deminick

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted: Inline code

Affected versions: 6.0.3, 6.0.4, 6.0.5

Due in version: 6.0.6, 4.11.9

Sprint:

Story Points:

Cycle: