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

Commit 244fcce

Browse files
Fixes issue #20
Also updated parameter names
1 parent 6979726 commit 244fcce

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,32 @@ private static ServiceContext Services
2222
get { return ApplicationContext.Current.Services; }
2323
}
2424

25-
public static IPublishedContent ConvertValueToContent(string id, string docTypeAlias, string dataJson)
25+
public static IPublishedContent ConvertValueToContent(string id, string contentTypeAlias, string dataJson)
2626
{
27-
if (string.IsNullOrWhiteSpace(docTypeAlias))
27+
if (string.IsNullOrWhiteSpace(contentTypeAlias))
2828
return null;
2929

3030
if (UmbracoContext.Current == null)
31-
return ConvertValue(id, docTypeAlias, dataJson);
31+
return ConvertValue(id, contentTypeAlias, dataJson);
3232

3333
return (IPublishedContent)ApplicationContext.Current.ApplicationCache.RequestCache.GetCacheItem(
34-
string.Concat("DocTypeGridEditorHelper.ConvertValueToContent_", id, "_", docTypeAlias),
34+
string.Concat("DocTypeGridEditorHelper.ConvertValueToContent_", id, "_", contentTypeAlias),
3535
() =>
3636
{
37-
return ConvertValue(id, docTypeAlias, dataJson);
37+
return ConvertValue(id, contentTypeAlias, dataJson);
3838
});
3939
}
4040

41-
private static IPublishedContent ConvertValue(string id, string docTypeAlias, string dataJson)
41+
private static IPublishedContent ConvertValue(string id, string contentTypeAlias, string dataJson)
4242
{
43-
using (var timer = DisposableTimer.DebugDuration<DocTypeGridEditorHelper>(string.Format("ConvertValueToContent ({0}, {1})", id, docTypeAlias)))
43+
using (var timer = DisposableTimer.DebugDuration<DocTypeGridEditorHelper>(string.Format("ConvertValueToContent ({0}, {1})", id, contentTypeAlias)))
4444
{
45-
Guid docTypeGuid;
46-
if (Guid.TryParse(docTypeAlias, out docTypeGuid))
47-
docTypeAlias = Services.ContentTypeService.GetAliasByGuid(docTypeGuid);
45+
Guid contentTypeGuid;
46+
if (Guid.TryParse(contentTypeAlias, out contentTypeGuid))
47+
contentTypeAlias = Services.ContentTypeService.GetAliasByGuid(contentTypeGuid);
4848

49-
var publishedContentType = PublishedContentType.Get(PublishedItemType.Content, docTypeAlias);
50-
var contentType = ApplicationContext.Current.Services.ContentTypeService.GetContentType(docTypeAlias);
49+
var publishedContentType = PublishedContentType.Get(PublishedItemType.Content, contentTypeAlias);
50+
var contentType = ApplicationContext.Current.Services.ContentTypeService.GetContentType(contentTypeAlias);
5151
var properties = new List<IPublishedProperty>();
5252

5353
// Convert all the properties
@@ -68,7 +68,7 @@ private static IPublishedContent ConvertValue(string id, string docTypeAlias, st
6868
propType.DataTypeId);
6969

7070
var contentPropData = new ContentPropertyData(
71-
jProp.Value != null ? jProp.Value.ToString() : null,
71+
jProp.Value,
7272
propPreValues,
7373
new Dictionary<string, object>());
7474

0 commit comments

Comments
 (0)