Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
We are having an issue transferring datatypes that use the KeyValuePrevalueEditor DataResolver in Courier 2.7 with Umbraco 6.1.1. We’ve upgraded to the latest nightly build of Courier (220.127.116.11) and the issue persists. We have been able to track the issue as far as a call to
When this method is called the Prevalues that are returned all have an Id of 0. The Alias, SortOrder and Value do match the cmsDataTypePreValues, just the Id is wrong. It appears that this Id is used by the DataResolver to set the value for Courier to transfer. The end result is that the value is always an empty string. A review of the Umbraco.Courier.Persistence.V6.NHibernate.dll seems to indicate that the Id is not being set. Below is a screenshot showing the issue in action with the application paused just after the call to RetrieveItem.
We will manually create our own fix - however, we'd greatly appreciate a fix in the core product!!
We are seeing this issue as well. You mentioned there's a fix included; are there updated dlls/diffs available for this?
What's interesting is dropdowns using custom controls instead of the standard KeyValue pair seems to transfer using courier just fine.
We used ILSpy to modify the Umbraco.Courier.Persistence.V6.NHibernate.dll. The problem area is near the end of the RetrieveItem method in the loop which assigns all the Prevalues (it is highlighted in the screenshot Steve posted). The fixed version of that loop is below.
foreach (CmsDataTypePreValue dataTypePreValue in Enumerable.Where((IEnumerable) currentSession.CreateCriteria().List(), (Func) (x => x.DatatypeNodeId == dt.UmbracoNode.Id)))
Value = dataTypePreValue.Value,
Alias = dataTypePreValue.Alias,
SortOrder = dataTypePreValue.Sortorder,
Id = dataTypePreValue.Id
How did I not know about ILSpy? Thanks much, that was really helpful!
How do I modifly and save the DLL?Or did you create a class that overrides this?
Hi Nick. We used ILSpy to decompile the DLL then made the change and recompiled it. We overwrite the original file with our updated version. I should note that we ended up dropping Courier from this project due to issues similar to this repeatedly cropping up so we haven't been able to test the long term effects of this change. YMMV
Okay I managed to decompile and recompile however I get this during couriering:System.InvalidCastException: Unable to cast object of type 'System.Int32' to type 'System.String'. at Umbraco.Courier.Persistence.V6.NHibernate.Persisters.DocumentItem.RetrieveItem[T]
Seems like Id is sometimes a string or something isn't casting properly
I found the bugI had to change Document.cs in Persisters.DocumentItem line 142 to:document1.CourierFileName = cmsDocument.Text + (object) "_" + cmsDocument.UmbracoNode.Id.ToString();and now it works!Is anyone from the courier development team seeing this???
Jonathan's fix seems to work for me, but i would like to add that this only works when your datatype is being saved as an integer, when it is set to nvarchar or text this fix does not seem to work. Don't know if anyone ever created a support ticket? I just did :)
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted