Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Vishal G.P 62 posts 122 karma points
    Aug 14, 2014 @ 21:50
    Vishal G.P
    0

    SEO Checker 1.5.2 and Vorto 1.2 Incompatibility

    Hey Richard,

    i think a very similar problem appears with Vorto package 1.2 and SEOChecker.

    Especially when you try to call the vorto extension on a IPublishedContent.. GetVortoValue()..

    I first thought it was a vorto issue and already created a issue with Matt from Vorto.

    What i then did, was added the vorto project and debugged it.

    it broke on this method in vorto:

    private static PublishedPropertyType CreateDummyPropertyType(int dataTypeId, string propertyEditorAlias)
        {
            return new PublishedPropertyType(null,
                new PropertyType(new DataTypeDefinition(-1, propertyEditorAlias)
                {
                    Id = dataTypeId
                }));
        }
    

    But the problem was in the contructor of PublishedPropertyType in the core of umbraco and especially in the InitializeConverters() method.

    So i went further and added the Umbraco.Core project from 7.1.4 to my solution and debugged further.

    And then I saw that it broke on the method IsConverterFor on the {SEOChecker.MVC.PropertyEditorConverters.SEOCheckerMetadataConverter}

      IEnumerable<IPropertyValueConverter> GetCompatConverters()
        {
            var propertyEditorGuid = LegacyPropertyEditorIdToAliasConverter.GetLegacyIdFromAlias(PropertyEditorAlias, LegacyPropertyEditorIdToAliasConverter.NotFoundLegacyIdResponseBehavior.ReturnNull);
            return PropertyEditorValueConvertersResolver.HasCurrent && propertyEditorGuid.HasValue
                ? PropertyEditorValueConvertersResolver.Current.Converters
                    .Where(x => x.IsConverterFor(propertyEditorGuid.Value, ContentType.Alias, PropertyTypeAlias))
                    .Select(x => new CompatConverter(x))
                : Enumerable.Empty<IPropertyValueConverter>();
        }
    

    Here is a screenshot of the debugger: enter image description here

    And this is where i cannot go any further, because i don't know why IsConverterFor breaks.

    I'm using umbraco 7.1.4 and Vorto 1.2 in combination with SEO checker 1.5.2 at the moment.

    Steps are:

    1. Clean Umb 7.1.4
    2. install Vorto 1.2 (via Nuget) or just get the source)
    3. Install SEO Checker.
    4. Create SEO Checker datatype
    5. Create 1 or 2 languages(cultures) in your sites
    6. Create Vorto Datatype (textstring for example)
    7. Add both datatypes to the same doctype
    8. Now on your template (view) try to get the value of the vorto property using @Model.Content.GetVortoValue("Alias") <dont forget the @using Our.Umbraco.Model.Extentsions >
    9. Refresh the page and it should break.

    We are on a big project at the moment. And i cannot afford to lose one or both of these packages, so i really need your help on this.

    Hope to hear from you soon.

    Regards, Vishal (Tam Tam)

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Aug 14, 2014 @ 22:37
    Matt Brailsford
    0

    Hi Vishal,

    Ok, I think I see where the issue is (from a Vorto perspective anyway). When Umbraco looks up legacy property editor value converters, it passes in the content type alias, however in my CreateDummyPropertyType method, you can see we pass in null (the first constructor arg of PublishedPropertyType) for the content type, so when Umbraco calls ContentType.Alias, it fails because ContentType is null.

    Now, from a vorto perspective I can look into seeing if there is a way to pass in an empty content type (unfortunately it looks like all PublishedContentType's constructors are internal), however, I would query whether you a) are indeed running SEO Checker 1.5.2? and b) whether your SEOChecker.MVC.dll file has been updated correctly?

    From SEO Checkers changelog it seems in 1.5.2, it was upgraded to use the new IPublishedValueConveter which should mean that the old legacy converter was removed, which in turn should mean it should no longer get looked up in the Umbraco lookup code.

    If you are in a position to, I would suggest making sure you are running from all the correct 1.5.2 dll's, and maybe even look to upgrade to 1.6 and see if that is a quick fix for the time being.

    I hope this helps.

    Many thanks

    Matt

  • Vishal G.P 62 posts 122 karma points
    Aug 15, 2014 @ 09:03
    Vishal G.P
    0

    Hey Matt,

    I slept on it, and this morning i was thinking exactly what you said.. You are sending the Null parameter in your CreateDummyPropertyType method,which is causing the nullref exception on the ContentType.Alias call.

    I also saw that in 1.5.2 it was upgraded to use the new IPublishedValueConverter, but still the code failed.

    I checked and i'm indeed using 1.5.2 SeoChecker.MVC.dll. I will upgrade later today to 1.6. I hope that it fixes it. It's a bit busy today.

    Otherwise i hope there is a way Vorto CreateDummyPropertyType method can be altered to avoid this problem.

  • Vishal G.P 62 posts 122 karma points
    Aug 15, 2014 @ 16:21
    Vishal G.P
    100

    Upgrade to SEOChecker 1.6 fixes the issue with Vorto 1.2

Please Sign in or register to post replies

Write your reply to:

Draft