Insert image through RTE: System.NotSupportedException The type System.Collections.Generic.Dictionary`2[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] is not supported because it implements IDictionary
Description: HTTP 500.Error processing request.
Details: Non-web exception. Exception origin (name of application or object): System.Xml. http://127.0.0.1:8080/umbraco/controls/Images/ImageViewerUpdater.asmx/UpdateImage at System.Xml.Serialization.TypeData.get_ListItemType () [0x000cf] in /home/kol3/Development/mono/mcs/class/System.XML/System.Xml.Serialization/TypeData.cs:331
This error can be traced to .../umbraco/presentation/umbraco/controls/images/imageViewer.ascx.cs line 96,
which calls umbraco.IO.IOHelper.ResolveUrl(...) in .../umbraco/businesslogic/IO/IOHelper.cs 44:50
In line 49, note the call to: VirtualPathUtility.ToAbsolute(string virtualPath, string AppPath).
In the mono implementation AppPath cannot be null.
We resolve as follows: .../umbraco/businesslogic/IO/MultiplatformHelper.cs, add
public static string EnsureRootAppPath (string path)
{
if (IsUnix && (path == String.Empty))
return "/";
return path;
}
Then in .../umbraco/businesslogic/IO/IOHelper.cs, change line 49 from,
return VirtualPathUtility.ToAbsolute(virtualPath, SystemDirectories.Root);
to
return VirtualPathUtility.ToAbsolute(virtualPath, MultiPlatformHelper.EnsureRootAppPath(SystemDirectories.Root));
While we are at it we'll also refactor in as follows (and update all references as needed)
public static bool IsWindows
{
get
{
return OSPlatform.Contains(PLATFORM_WIN);
}
}
public static bool IsUnix
{
get
{
return OSPlatform.Contains(PLATFORM_UNIX);
}
}
Upload png (any image) media: uploaded but not correct format error issued.
In .../umbraco/presentation/umbraco/controls/ContentControl.cs, change line 447
from
if (p.PropertyType.ValidationRegExp != "")
to
if (p.PropertyType.ValidationRegExp != null && p.PropertyType.ValidationRegExp != "")
The conditional should work, but mono is converting "" to null, and this casues the conditional to fail and give a false error message.
No comments:
Post a Comment
Note: only a member of this blog may post a comment.