Fixes: U4-4853 Richtext Editor doesn't render macros after upgrade to Umbraco 6.2.0
This commit is contained in:
@@ -354,6 +354,9 @@ namespace umbraco
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LogHelper.WarnWithException<macro>(
|
||||
"Error loading partial view macro (View: " + Model.ScriptName + ")", true, e);
|
||||
|
||||
renderFailed = true;
|
||||
Exceptions.Add(e);
|
||||
macroControl = handleError(e);
|
||||
@@ -1824,6 +1827,12 @@ namespace umbraco
|
||||
|
||||
public static string MacroContentByHttp(int PageID, Guid PageVersion, Hashtable attributes)
|
||||
{
|
||||
|
||||
if (SystemUtilities.GetCurrentTrustLevel() != AspNetHostingPermissionLevel.Unrestricted)
|
||||
{
|
||||
return "<span style='color: red'>Cannot render macro content in the rich text editor when the application is running in a Partial Trust environment</span>";
|
||||
}
|
||||
|
||||
string tempAlias = (attributes["macroalias"] != null)
|
||||
? attributes["macroalias"].ToString()
|
||||
: attributes["macroAlias"].ToString();
|
||||
|
||||
@@ -550,7 +550,13 @@ namespace umbraco.NodeFactory
|
||||
{
|
||||
if (HttpContext.Current.Items["pageID"] == null)
|
||||
throw new InvalidOperationException("There is no current node.");
|
||||
return (int)HttpContext.Current.Items["pageID"];
|
||||
|
||||
var intAttempt = HttpContext.Current.Items["pageID"].TryConvertTo<int>();
|
||||
if (intAttempt == false)
|
||||
{
|
||||
throw new InvalidOperationException("The pageID value in the HttpContext.Items cannot be converted to an integer");
|
||||
}
|
||||
return intAttempt.Result;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user