Skip to content
This repository was archived by the owner on Feb 10, 2024. It is now read-only.

Commit df1fc50

Browse files
committed
Cancels preview request if redirected
If the DTGE preview result is a redirect, then we cancel the request. The issue here is that typically a redirect from a controller would be to a full-loading HTML page. Meaning that a full bodied HTML page would be injected into a DTGE grid cell, causing havoc. This is a temporary resolution until we implement a more robust DTGE previewer mechanism.
1 parent 615b7d9 commit df1fc50

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Our.Umbraco.DocTypeGridEditor/Web/Attributes/DocTypeGridEditorPreviewAttribute.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ public override void OnResultExecuting(ResultExecutingContext filterContext)
1616
viewResult.ViewName =
1717
"~/App_Plugins/DocTypeGridEditor/Render/DocTypeGridEditorPreviewer.cshtml";
1818
}
19+
// NOTE: [LK:2016-11-16] If the preview result is a redirect, then cancel the request.
20+
// The issue here is that typically a redirect from a controller would be to a full-loading HTML page.
21+
// Meaning that a full bodied HTML page would be injected into a DTGE grid cell, causing havoc.
22+
// This is a temporary resolution until we implement a more robust DTGE previewer mechanism.
23+
else if (filterContext.Result is RedirectResult)
24+
{
25+
filterContext.Cancel = true;
26+
}
1927
}
2028

2129
base.OnResultExecuting(filterContext);

0 commit comments

Comments
 (0)