Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetCropUrl Url extension has duplicate signatures and results in error #10402

Closed
T9Creative opened this issue Jun 6, 2021 · 3 comments
Closed

Comments

@T9Creative
Copy link

T9Creative commented Jun 6, 2021

Which Umbraco version are you using?

8.14.0

Bug summary

After upgrading to 8.14.0, some of my image crops were not working. After looking into it, I believe I have found the issue.

In my code I have the following: @Url.GetCropUrl(item.Property, cropAlias:"Featured", width: 1200)

And when trying to compile, I get "This call is ambiguous between the following methods or properties".

Specifics

No response

Steps to reproduce

This seems to also be the case for a new install of 8.14.0

  • Add image cropper property to document, add a named crop
  • This in code results in an error @Url.GetCropUrl(Model.TestImage, cropAlias: "Test", width:200)

Note: if I don't the parameter name, such as @Url.GetCropUrl(Model.TestImage, "Test"), it works. (Edit, t

I am not quite sure, but I think the offending methods are:

public static IHtmlString GetCropUrl(this UrlHelper urlHelper,

and

public static IHtmlString GetCropUrl(this UrlHelper urlHelper,

Hoping someone can verify, thanks!

Expected result / actual result

No response

@quinlandm
Copy link

nul800sebastiaan added a commit that referenced this issue Jun 24, 2021
…results in error

This is a breaking change for people using `GetCropUrl` to get local crops from the media picker v3. In order to disambiguate the extension method an make  it a bit clearer what it does, I propose the method name change, after which there is no need to have the first argument being the local crops, but it can be the whole MediaWithCrops object, since the method name already makes clear you're not trying to get the global crops.
@nul800sebastiaan
Copy link
Member

Thanks for the reports @T9Creative and @quinlandm and sorry for the late reply, we somehow missed this one. We're looking into the best way to fix this now, we'll update when we have more info! Very sorry for the inconvenience! 😬

nul800sebastiaan added a commit that referenced this issue Jul 12, 2021
We added an overload that would conflict for people with existing templates, that was a bit too premature. Disabled for now with a note to look into it for v9 again.
@nul800sebastiaan
Copy link
Member

This should be fixed for 8.15.0, due out on Thursday. 2a6bdf7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment