Fixes: U4-4853 Richtext Editor doesn't render macros after upgrade to Umbraco 6.2.0

This commit is contained in:
Shannon
2014-05-13 15:22:16 +10:00
parent 937e840104
commit 78613823ae
2 changed files with 16 additions and 1 deletions

View File

@@ -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();

View File

@@ -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;
}
}
}