We have moved to GitHub Issues
Created by Dirk 10 Sep 2013, 10:24:01 Updated by Shannon Deminick 11 Sep 2013, 01:57:42
Relates to: U4-2713
I suggest that Umbraco.Core.ObjectExtensions.TryConvertTo checks for destinationType == typeof(string) and returns input.ToString() in this case. Thus a PEVC can implement the ToString method. This should simply return the property value as string. Just add the following line: public static Attempt
if (destinationType == typeof(object)) return new Attempt
fix of issue U4-2713 is kind of breaking change ?
@Dirk, it's more of an un-breaking change but really more of a bug that has been fixed, it was never supposed to be that way. I'll chat to @Seb, it would be a shame to not release this code and just leave it broken until v7. There's really no other way around it and we're not about to go creating configuration sections for compatibility modes since that essentially means we not only have to start checking versions but also compatibility flags when doing support.
I like this request regarding the string check, it makes good sense.
I'm moving the logic to the bottom of the sequence though:
if (input == null) return Attempt<object>.False; if (destinationType == typeof(object)) return new Attempt<object>(true, input); if (input.GetType() == destinationType) return new Attempt<object>(true, input); if (destinationType == typeof(string)) return new Attempt<object>(true, input.ToString());
Logically we should check the string after we've checked if it is already a string
Done in 9f1d212375058cd784e6bdaf6dddf8527be8cb70
Assignee: Shannon Deminick
Backwards Compatible: True
Affected versions: 6.2.0
Due in version: 6.2.0