Using v1.5.1 (Umbraco v6.1.6) I get the below exception why trying to add a new dictionary item at the root level, any ideas?
Server Error in '/' Application.
Top most dictionary items doesn't have a parent
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Top most dictionary items doesn't have a parent
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Yes it seems to be something intermittent - i saw it a few times developing but could never get to the bottom of it.
I went around the houses with the GetTop() function trying to go up to the top of the tree (dictionary items are odd, you actualy only save the top of the tree, it saves everything in one file)
private static Dictionary.DictionaryItem GetTop(Dictionary.DictionaryItem item)
{
if (!item.IsTopMostItem())
{
LogHelper.Debug<uSync>("is Top Most [{0}]", ()=> item.IsTopMostItem());
if (item.Parent != null)
{
LogHelper.Debug<uSync>("parent [{0}]", () => item.Parent.key);
return GetTop(item.Parent);
}
}
return item;
}
I don't know if it's in DictionaryItem.IsTopMenuItem().. or item.Parent.key.
I'll add some more debugging and see if i can get anyfurther
public DictionaryItem Parent
{
get
{
EnsureCache();
if (_parent == null)
{
var p = DictionaryItems.Values.SingleOrDefault(x => x.UniqueId == this.ParentId);
if (p == null)
{
throw new ArgumentException("Top most dictionary items doesn't have a parent");
}
else
{
_parent = p;
}
}
return _parent;
}
So for some reasons IsTopMost Returns false, then if ( item.Parent != null ) throws an exception
I've released a patched version of uSync to try and capture the exception being thrown.
v1.5.2 (now on our) - should at least not throw the error (it assumes that when the error gets thrown it's at the top of the tree (because parent is null)
there does appear to be one other way of triggering this error new v1.5.3 fixes the other doesn't have a parent issue that can sometimes happen (i think)
Top most dictionary items doesn't have a parent
Using v1.5.1 (Umbraco v6.1.6) I get the below exception why trying to add a new dictionary item at the root level, any ideas?
Server Error in '/' Application.
Top most dictionary items doesn't have a parent
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Top most dictionary items doesn't have a parent
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentException: Top most dictionary items doesn't have a parent] umbraco.cms.businesslogic.DictionaryItem.getParent() +187 jumps.umbraco.usync.SyncDictionary.DictionaryItemSaving(DictionaryItem sender, EventArgs e) +129 umbraco.cms.businesslogic.SaveEventHandler.Invoke(DictionaryItem sender, EventArgs e) +0 umbraco.cms.businesslogic.DictionaryItem.createKey(String key, Guid parentId, String defaultValue) +1197 umbraco.dictionaryTasks.Save() +283 umbraco.presentation.create.dialogHandlertemp.Create(String NodeType, Int32 TypeId, Int32 NodeId, String Text) +753 umbraco.cms.presentation.create.controls.simple.sbmtClick(Object sender, EventArgs e) +323 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +155 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3804
Yes it seems to be something intermittent - i saw it a few times developing but could never get to the bottom of it.
I went around the houses with the GetTop() function trying to go up to the top of the tree (dictionary items are odd, you actualy only save the top of the tree, it saves everything in one file)
I don't know if it's in DictionaryItem.IsTopMenuItem().. or item.Parent.key.
I'll add some more debugging and see if i can get anyfurther
Yes looking at the code / core - I think it's because you can't test for item.Parent without the core throwing the exception for you!
https://github.com/umbraco/Umbraco-CMS/blob/6c77749e32d9a8a6f0296953cca33acda24b68cf/src/umbraco.cms/businesslogic/Dictionary.cs
So for some reasons IsTopMost Returns false, then
if ( item.Parent != null )
throws an exceptionI'm going to fire that is an issue.
http://issues.umbraco.org/issue/U4-3187
Awesome! Thanks Kevin!
I've released a patched version of uSync to try and capture the exception being thrown.
v1.5.2 (now on our) - should at least not throw the error (it assumes that when the error gets thrown it's at the top of the tree (because parent is null)
Im using uSync 1.5.2 and Umbraco 6.1.6 and I'm still having the issue...
I was having this problem on 1.5.1. Version 1.5.2 fixed it for me. Thanks Kevin.
there does appear to be one other way of triggering this error new v1.5.3 fixes the other doesn't have a parent issue that can sometimes happen (i think)
is working on a reply...