Copied to clipboard

Flag this post as spam?

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


  • tentonipete 78 posts 223 karma points
    Apr 26, 2012 @ 22:52
    tentonipete
    0

    Question about uQuery breaking changes between 3.0 and 3.03

    I might be the only person out there who was using the mediaextensions!

    I was wondering why methods like uQueryExtensions.MediaExtensions.GetPropertyAsString() have been removed between versions? Are there better alternatives for getting properties from my custom media types?

  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Apr 26, 2012 @ 23:39
    Hendy Racher
    0

    Hi Joel,

    I didn't realise they had been removed ! That was unintentional - some methods were marked as obsolete (but should never be removed as that'd be a breaking change in an API). The idea for marking them as obsolete was to suggest the use of the genereric .GetProperty<T>("propertyAlias") method instead.

    HTH,

    Hendy

  • tentonipete 78 posts 223 karma points
    Apr 26, 2012 @ 23:49
    tentonipete
    1

    ahhh no worries, I just rolled back for now. Will probably update the references in my source when the GetProperty<T>() is added instead. Thanks for responding so quickly!

  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Apr 27, 2012 @ 10:12
    Hendy Racher
    1

    Hi ya,

    I've just checked the 3.0.3 dll and all the methods are still there *phew* (so no breaking changes).

    I wonder if the confusion has stemmed from the extension methods being moved up the object model hierarachy to extend the Content class (which Media inherits from) ?

    HTH,

    Hendy

  • tentonipete 78 posts 223 karma points
    Apr 27, 2012 @ 10:32
    tentonipete
    0

    Probably, I didn't investigate terribly thoroughly, I just wanted to get it to work, but I did get errors when I was calling those methods on a media object.

    string title = new Media(selectedFeatureImage.Id).GetPropertyAsString("featureTitle");
    

    I will check it again later.

  • Lee Kelleher 4026 posts 15837 karma points MVP 13x admin c-trib
    Apr 27, 2012 @ 12:19
    Lee Kelleher
    0

    Hi Joel,

    We found that we had duplicate "GetPropertyAs[whatever] methods for Document, Media and Members... since they all inherit from the Content object, we move the extension methods to there. 

    Your last code snippet *should* still work ... but if you are getting errors, let us know what they are ... we'll sort this out for a 3.0.4 patch.

    Cheers, Lee.

  • tentonipete 78 posts 223 karma points
    Apr 29, 2012 @ 17:50
    tentonipete
    0

    Checked again. When I update the version of uComponents on my site I get the following error:

    Method not found: 'System.String uComponents.Core.uQueryExtensions.MediaExtensions.GetPropertyAsString(umbraco.cms.businesslogic.media.Media, System.String)'.

    Doesn't seem to be a big deal as updating the reference in my project and rebuilding results in everything working fine!

    Had a poke around the DLL too, makes much more sense for the extensions to be on the Content object anyway. Thanks for your help chaps.

  • Lee Kelleher 4026 posts 15837 karma points MVP 13x admin c-trib
    Apr 29, 2012 @ 22:11
    Lee Kelleher
    0

    Hi Joel,

    Sorry about forcing the rebuild... didn't realise that it would have that impact, (although seems obvious now - doh!)

    Damn, this meant that change should have bumped the version number up to v3.1.0 (we're *trying* to follow SemVer now)

    Cheers, Lee.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies