Could not parse internal links, there is no curren...
# help-with-umbraco
c
Hey everyone! I’m looking for some help with an issue we’re facing on our platform. Context: Our platform allows users to create an account and place real estate investments on different offerings and once completed they are taken to a Docusign signing page. We’re integrated with DocuSign and use a dynamic field in Umbraco to store the docuSignTemplateId. The Problem: When a new account is created and places their first investment, we’re getting this error in the logger:
System.InvalidOperationException: Could not parse internal links, there is no current UmbracoContext
. The Code: Here’s the part where the error occurs:
m.Value<string>("docuSignTemplateId");
And here’s the full code snippet:
Copy code
var ctx = HttpContext.Current;
string offeringId = ctx.Request["offeringId"];
IPublishedContent m = Umbraco.Content(offeringId);
var docuSignTemplateId = "";
docuSignTemplateId = m.Value<string>("docuSignTemplateId");
What I Think: It seems like the UmbracoContext isn’t available at the point where this code runs, possibly because it’s being called outside of a valid HTTP request lifecycle. Has anyone faced a similar issue or know the best way to handle this scenario? Any guidance on ensuring UmbracoContext is available or how to rewrite this code would be appreciated! Thanks in advance! 🙌
a
You can use the umbracoContentAccessor to get the context https://docs.umbraco.com/umbraco-cms/13.latest/reference/querying/umbraco-context
5 Views