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

Commit 383dda8

Browse files
authored
Merge pull request #225 from Matthew-Wise/feature/variantion-context-preview-fix
Fixes issue when previewing linked content items
2 parents fc09a3a + 6e47513 commit 383dda8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Our.Umbraco.DocTypeGridEditor/Web/Controllers/DocTypeGridEditorApiController.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class DocTypeGridEditorApiController : UmbracoAuthorizedJsonController
3131
private readonly IContentTypeService _contentTypeService;
3232
private readonly IDataTypeService _dataTypeService;
3333
private readonly IPublishedContentCache _contentCache;
34-
34+
3535
public DocTypeGridEditorApiController()
3636
{
3737
}
@@ -157,7 +157,7 @@ public HttpResponseMessage GetPreviewMarkup([FromBody] PreviewData data, [FromUr
157157
UmbracoContext.PublishedRequest = router.CreateRequest(UmbracoContext, Request.RequestUri);
158158
UmbracoContext.PublishedRequest.PublishedContent = page;
159159
}
160-
160+
161161
// Set the culture for the preview
162162
if (page != null && page.Cultures != null)
163163
{
@@ -168,6 +168,7 @@ public HttpResponseMessage GetPreviewMarkup([FromBody] PreviewData data, [FromUr
168168
UmbracoContext.PublishedRequest.Culture = culture;
169169
System.Threading.Thread.CurrentThread.CurrentCulture = culture;
170170
System.Threading.Thread.CurrentThread.CurrentUICulture = culture;
171+
UmbracoContext.VariationContextAccessor.VariationContext = new VariationContext(culture.Name);
171172
}
172173
}
173174

0 commit comments

Comments
 (0)