0
Fixed

Multivalue DN validator throws an invalid cast error

Matthew Clark 7 years ago • updated by anonymous 4 years ago 1

When attempting to create the correct value during an export, a multivalue DN generator field throws a cast exception:

Unable to cast object of type 'Unify.Framework.MultiValue`1Unify.Framework.StringValue' to type 'System.Collections.IEnumerable'.
> Unify.IdentityBroker.Entity.Schema.dll!Unify.Product.IdentityBroker.EntityMultiValueObjectTypeSchemaValidator<Unify.Framework.MultiValue<Unify.Framework.DistinguishedNameValue>,Unify.Framework.DistinguishedNameValue,Unify.Framework.IO.DistinguishedName>.CreateValue(object dataValue) Line 90 + 0x13 bytes C#
Unify.IdentityBroker.Entity.Schema.dll!Unify.Product.IdentityBroker.EntitySchemaFieldDefinition.CreateValue(object dataValue) Line 64 + 0x39 bytes C#
Unify.IdentityBroker.Adapter.LDIF.dll!Unify.Product.IdentityBroker.LDIFToAdapterEntitySaveAdapterBase<Unify.Product.IdentityBroker.IAdapterEntitySaveChange>.ConvertValues.AnonymousMethod_c(<>f_AnonymousType0<Unify.Product.IdentityBroker.AdapterEntityValueCollectionKey,System.Collections.Generic.List<Unify.Framework.StringValue>> item) Line 143 + 0xe4 bytes C#
System.Core.dll!System.Linq.Enumerable.WhereSelectEnumerableIterator<System.Linq.IGrouping<Unify.Product.IdentityBroker.AdapterEntityValueCollectionKey,Unify.Framework.StringValue>,System.Collections.Generic.KeyValuePair<Unify.Product.IdentityBroker.AdapterEntityValueCollectionKey,Unify.Framework.IValue>>.MoveNext() + 0x104 bytes
System.Core.dll!System.Linq.Buffer<System.Collections.Generic.KeyValuePair<Unify.Product.IdentityBroker.AdapterEntityValueCollectionKey,Unify.Framework.IValue>>.Buffer(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<Unify.Product.IdentityBroker.AdapterEntityValueCollectionKey,Unify.Framework.IValue>> source) + 0x24b bytes
System.Core.dll!System.Linq.Enumerable.ToArray<System.Collections.Generic.KeyValuePair<Unify.Product.IdentityBroker.AdapterEntityValueCollectionKey,Unify.Framework.IValue>>(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<Unify.Product.IdentityBroker.AdapterEntityValueCollectionKey,Unify.Framework.IValue>> source) + 0x67 bytes
Unify.IdentityBroker.Adapter.LDIF.dll!Unify.Product.IdentityBroker.LDIFToAdapterEntitySaveChangeAdapter.GetConvertedValuesFromSchema(string objectClass, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,string>> values) Line 153 + 0xda bytes C#
Unify.IdentityBroker.Adapter.LDIF.dll!Unify.Product.IdentityBroker.LDIFToAdapterEntitySaveChangeAdapter.Transform(System.IO.Stream sourceValue) Line 120 + 0x4c bytes C#
Unify.IdentityBroker.Adapter.Remoting.dll!Unify.Product.IdentityBroker.LDIFAdapterBase.ExportChanges(Unify.Product.IdentityBroker.ExportedLDIFForAdapter exportedLdifForAdapter) Line 244 + 0xbe6 bytes C#

Source value in this case is a single entry: CN=Administrator,DC=UNIFY2010DEMO. The object attempting a cast is a MultiValue<StringValue> as parsed by the LDIF handling.

Affected Versions:
Fixed by Version:

Changed handling of multivalues such that the enumerable is passed through to the validator. Tested for multivalue attributes, and confirmed single value field updates haven't regressed. Issue resolved and closed.