callumbwhyte / super-value-converters

A collection of powerful property value converters for cleaner code in Umbraco
MIT License
14 stars 12 forks source link

Supervalue Converters (MNTP replacement) Breaks UmbracoInternalRedirectId property #21

Closed NikRimington closed 2 years ago

NikRimington commented 2 years ago

Hey @callumbwhyte

Using MNTP as a property type for UmbracoInternalRedirectId Property and having SVC's installed breaks the UmbracoInternalRedirectsId functionalty (And the UmbracoRedirect functionality).

The core PVC has the following private collection as part of it:

private static readonly List<string> PropertiesToExclude = new List<string>
{
      Constants.Conventions.Content.InternalRedirectId.ToLower(CultureInfo.InvariantCulture),
      Constants.Conventions.Content.Redirect.ToLower(CultureInfo.InvariantCulture)
 };

Then, in the ConvertIntermediateToObject method it does a check to see if the property alias is that of one of the excluded types. If it is, it then bypasses the conversion process.

I believe you need something similar in your MNTP replacement PVC

callumbwhyte commented 2 years ago

Hey @NikRimington,

I have released v2.2 (for V8) and v3.1 (for V9) just now with this feature included. You will see the SuperValueConverterBase class includes a new overridable IgnoreProperties property. This is set to include the redirect properties for the MNTP.

Hopefully this solution works for you!

Cheers, Callum