Copied to clipboard

Flag this post as spam?

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


  • nikita 6 posts 56 karma points
    May 13, 2015 @ 04:03
    nikita
    0

    Problem with setting up the Twitter Authorize using Skyburd.Social

    Hi,

    My current Umbraco version is : 7.2.4

    I am trying to setup the twitter authorize using skyburd.Social, I am getting the following error on clicking the authorize button

    "Hold on now! The options of the underlying prevalue editor isn't valid. "

    I have set the consumer Key and Consumer secret in the Datatype.

    In the twitter apps setting  I have also setup the call back url.

    Could not find where the problem is with.

    Thinking my above information is sufficient for understanding my issue.

    Could you please look into this issue and help me in this regard to proceed further.

     

  • nikita 6 posts 56 karma points
    May 13, 2015 @ 05:44
    nikita
    100

    Hi,

    I could be able to figure out why there was an issue as mentioned above.

    In my document types I was setting the Twitter authorize on a Document type composition , instead of setting it directly on the Home Page.

    As it was part of Document type Composition, it could not get the property type and its values .

    The reason for this was :

    In PreValueHelpers.cs : Skybrud.Social is trying to get the Property type as follows:

    publicstaticIDictionary<string, string> GetPreValues(string contentTypeAlias, string propertyAlias) { IContentType contentType = ContentTypeService.GetContentType(contentTypeAlias); PropertyType property = contentType == null ? null : contentType.PropertyTypes.FirstOrDefault(x => x.Alias == propertyAlias);
    return property == null ? newDictionary<string, string>() : GetPreValues(property.DataTypeDefinitionId);
    }

    By modifying above method  as follows fixes the issue.

    publicstaticIDictionary<string, string> GetPreValues(string contentTypeAlias, string propertyAlias) { IContentType contentType = ContentTypeService.GetContentType(contentTypeAlias); PropertyType property = contentType == null ? null : contentType.PropertyTypes.FirstOrDefault(x => x.Alias == propertyAlias); if (property == null)
    {
    property = contentType.CompositionPropertyTypes.FirstOrDefault(x => x.Alias == propertyAlias);
    }
    return property == null ? newDictionary<string, string>() : GetPreValues(property.DataTypeDefinitionId);
    }

    Before Skybrud.Social was getting property type which was available only on Content type page directly.

    Now, I have modified such that if the property type is returning null or empty then it gets the property type available on Document type Composition.

    Cheers,

    Nikita

Please Sign in or register to post replies

Write your reply to:

Draft