Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
LeBlender is crashing when GetGridHtml is called in WebAPI.
Example:
int nodeId = 1300; UmbracoHelper helper = new UmbracoHelper(UmbracoContext.Current); IPublishedContent samplecontent= helper.TypedContent(nodeId); samplecontent.GetGridHtml("grid");
The crash is because of HttpContext.Current.Request["id"] does not exist in LeBlenderHelper.cs. (Line 234)
When for example
item.GetValue<string>("text")
is called the code crashed and no value is returned.
I found a simple workaround, but don't know if this is the right solution.
Changed the code in LeBlenderHelper.cs. (Line 222 till 245)
internal static PublishedContentType GetTargetContentType() { if (UmbracoContext.Current.IsFrontEndUmbracoRequest) { return GetUmbracoHelper().AssignedContentItem.ContentType; } else if (!string.IsNullOrEmpty(HttpContext.Current.Request["doctype"])) { return PublishedContentType.Get(PublishedItemType.Content, HttpContext.Current.Request["doctype"]); } else if(!string.IsNullOrEmpty(HttpContext.Current.Request["id"])) { int contenId = int.Parse(HttpContext.Current.Request["id"]); return (PublishedContentType)ApplicationContext.Current.ApplicationCache.RuntimeCache.GetCacheItem( "LeBlender_GetTargetContentType_" + contenId, () => { var services = ApplicationContext.Current.Services; var contentType = PublishedContentType.Get(PublishedItemType.Content, services.ContentService.GetById(contenId).ContentType.Alias); return contentType; }); } return null; }
Can this be fixed in next version?
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Web api - GetGridHtml not working
LeBlender is crashing when GetGridHtml is called in WebAPI.
Example:
The crash is because of HttpContext.Current.Request["id"] does not exist in LeBlenderHelper.cs. (Line 234)
When for example
is called the code crashed and no value is returned.
I found a simple workaround, but don't know if this is the right solution.
Changed the code in LeBlenderHelper.cs. (Line 222 till 245)
Can this be fixed in next version?
is working on a reply...