Copied to clipboard

Flag this post as spam?

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


  • David Quinlan 8 posts 79 karma points
    Jun 10, 2021 @ 12:53
    David Quinlan
    0

    Update to Umbraco 8.14.0 - GetCropUrl conflict

    Strange one this, I've just updated to Umbraco 8.14.0 - performed clean solution and rebuild of site, to click around and see all working, and I received an exception on one of my partial views.

    Severity Code Description Project File Line Suppression State Error CS0121 The call is ambiguous between the following methods or properties: 'UrlHelperRenderExtensions.GetCropUrl(UrlHelper, ImageCropperValue, int?, int?, string, int?, ImageCropMode?, ImageCropAnchor?, bool, bool, string, string, ImageCropRatioMode?, bool, bool)' and 'UrlHelperRenderExtensions.GetCropUrl(UrlHelper, ImageCropperValue, string, int?, int?, int?, ImageCropMode?, ImageCropAnchor?, bool, bool, string, string, ImageCropRatioMode?,

    Looking at metadata for UrlHelperRenderExtensions - it is showing two methods for GetCropUrl - with same parameters but in different order? Documentation online only shows one of these methods..

    From Metadata

  • shekhar sharma 22 posts 110 karma points
    Jun 10, 2021 @ 13:59
    shekhar sharma
    0

    Hello David ,

    Hope you having the backup before upgrade. It seems while upgrade your Old reference didn't removed from the Config files or dll. Just try to look below point in your application.

    • Compare the Dll ( Image Processor Form Old Sol to New Upgrade Sol) Remove old Dll
    • See the ImageProcessorModule Reference in WebConfig File and compare it with the Old. Remove to old references.
    • Compare the Config/ImageProcessor Files with the old Config/ImageProcessor.

    Rebuild and see again. Hope this resolved your Issues..

    Thanks,

    Shekhar

  • David Quinlan 8 posts 79 karma points
    Jun 10, 2021 @ 14:45
    David Quinlan
    0

    Hi Shekar, I've already tried the following:

    Deleted obj/bin folders / cleaned solution etc.. only change to web.config during update was change from 8.13.0 to 8.14.0 config/ImageProcessor files unchanged in upgrade

    Tried upgrade again from clean branch off my master (v 8.13.0) still same problems with this code that previously worked fine. The documentation on GetCropUrl() is very convoluted and not clear at all.

    so, no doesn't resolve.

  • shekhar sharma 22 posts 110 karma points
    Jun 10, 2021 @ 14:55
    shekhar sharma
    0

    Hi David,

    It Just duplicate reference somewhere in your application Like same Reference written two times. It could be in WebConfig or Config/ImageProcessor Config Files.

    Apology it still didn't resolve your issue. Because without seeing it in code. Its Very difficult to answer it..

    Thanks, Shekhar

  • David Quinlan 8 posts 79 karma points
    Jun 10, 2021 @ 16:26
    David Quinlan
    0

    Don't think so.. I've rolled back in 8.13.0 all works fine.

    An override added in 8.14.0 seems odd.. only difference I can see to other method is cropAlias has default value of null in one version.

    https://github.com/umbraco/Umbraco-CMS/blob/v8/contrib/src/Umbraco.Web/UrlHelperRenderExtensions.cs

    see lines 240 & 265

  • Yakov Lebski 591 posts 2346 karma points
    Jun 10, 2021 @ 16:55
    Yakov Lebski
    0

    In my case I just added name to parameter

    instaed of

    Model.Value<ImageCropperValue>("pageImage"), "article", ....)
    

    changed to Model.Value<ImageCropperValue>("pageImage"), cropAlias: "article" ...)

  • David Quinlan 8 posts 79 karma points
    Jun 11, 2021 @ 09:37
    David Quinlan
    0

    This is my code..

           var thumbnail = Url.GetCropUrl(post.PostImage, cropAlias: "blogListWide", useCropDimensions: true, htmlEncode: false, upScale: false);
    

    which worked in 8.13.0 - that fails in 8.14.0 ...

    post.PostImage is from Articulate Blog

    even specifying all optional params .. says it's ambiguous..

     var thumbnail = Url.GetCropUrl(imageCropperValue: post.PostImage,
                                                                                   width: null,
                                                                                   height: null,
                                                                                   cropAlias: "blogListWide",
                                                                                   quality: null,
                                                                                   imageCropMode: null,
                                                                                   imageCropAnchor: null,
                                                                                   preferFocalPoint: false,
                                                                                   useCropDimensions: false,
                                                                                   cacheBusterValue: null,
                                                                                   furtherOptions: null,
                                                                                   ratioMode: null,
                                                                                   upScale: false,
                                                                                   htmlEncode: false);
    
  • David Quinlan 8 posts 79 karma points
    Jun 11, 2021 @ 09:42
    David Quinlan
    1

    Ah, it's already been raised as an issue!

    https://github.com/umbraco/Umbraco-CMS/issues/10402

Please Sign in or register to post replies

Write your reply to:

Draft