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

Commit 4da8868

Browse files
committed
fixed caching bug.
1 parent 57ab1a7 commit 4da8868

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/Our.Umbraco.DocTypeGridEditor/Helpers/DocTypeGridEditorHelper.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ namespace Our.Umbraco.DocTypeGridEditor.Helpers
1818
public static class DocTypeGridEditorHelper
1919
{
2020

21-
public static IPublishedElement ConvertValueToContent(string id, string contentTypeAlias, string dataJson, bool isPreview = false)
21+
public static IPublishedElement ConvertValueToContent(string id, string contentTypeAlias, string dataJson)
2222
{
2323
if (string.IsNullOrWhiteSpace(contentTypeAlias))
2424
return null;
2525

2626
if (dataJson == null)
2727
return null;
2828

29-
if (Current.UmbracoContext == null || isPreview)
29+
if (Current.UmbracoContext == null)
3030
return ConvertValue(id, contentTypeAlias, dataJson);
31-
32-
return (IPublishedElement)Current.AppCaches.RuntimeCache.GetCacheItem(
31+
32+
return (IPublishedElement)Current.AppCaches.RequestCache.GetCacheItem(
3333
$"Our.Umbraco.DocTypeGridEditor.Helpers.DocTypeGridEditorHelper.ConvertValueToContent_{id}_{contentTypeAlias}",
3434
() =>
3535
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public HttpResponseMessage GetPreviewMarkup([FromBody] PreviewData data, [FromUr
181181
}
182182

183183
// Get content node object
184-
var content = DocTypeGridEditorHelper.ConvertValueToContent(data.Id, data.ContentTypeAlias, data.Value, true);
184+
var content = DocTypeGridEditorHelper.ConvertValueToContent(data.Id, data.ContentTypeAlias, data.Value);
185185

186186
// Construct preview model
187187
var model = new PreviewModel

0 commit comments

Comments
 (0)