U4-3633 - ambiguous call in partial

Created by Yannick Smits 21 Nov 2013, 11:27:50 Updated by Sebastiaan Janssen 20 Mar 2014, 17:14:05

After installing the txt starter kit, front end site workes correctly. Then after changing some content nodes this error appeared on the frontend:

The call is ambiguous between the following methods or properties: 'Umbraco.Web.UmbracoHelper.Content(params int[])' and 'Umbraco.Web.UmbracoHelper.Content(params string[])'

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: The call is ambiguous between the following methods or properties: 'Umbraco.Web.UmbracoHelper.Content(params int[])' and 'Umbraco.Web.UmbracoHelper.Content(params string[])'

Source Error:

Line 7:

Source File: e:\goyaweb\Views\Partials\umbHomepageBanner.cshtml Line: 9

What causes the error to come up is this:

  1. Go to the home content page
  2. Go to the Banner section
  3. Add a banner link
  4. Publish
  5. Remove the banner link
  6. Publish

Adding back a banner link will remove the error.

Comments

Jeroen Breuer 02 Feb 2014, 19:31:18

I just run into this issue after installing the txt starter kit on 7.0.2.


Devin Bost 03 Feb 2014, 10:22:39

I am also experiencing this issue after installing the txt starter kit on 7.0.2. I removed the banner link from the document type and removed the Html.RenderPartial call in the template, and the problem disappeared.


Jeroen Breuer 05 Feb 2014, 10:36:46

I'm only getting this error after adding extra properties to the home node. Also happening on 7.0.3.


Devin Bost 18 Feb 2014, 00:39:17

I also noticed that this problem is occurring on 7.0.3. It seems to occur whenever I try to to put a reference to an Umbraco field in one of my partial views.


Domingo Trujillo 13 Mar 2014, 01:49:07

Also happening on 7.0.4. SOLUTION: For fix this issue check the option "Hide Banner". On "Home/Banner" path. Then "Save and Publish" That's it.


Calle Bjernekull 13 Mar 2014, 07:27:57

@dbost I agree Devin. I don't think this has anything to do with the txt starter-kit. Seems like the Umbraco.Field()-function doesn't work in partial views.


George Tsiagis 13 Mar 2014, 14:20:50

The problem goes away if you add .ToString() to the hyperlink in umbHomepageBanner partial view. ie change CurrentPage.BannerLink -> CurrentPage.BannerLink.ToString()


Sebastiaan Janssen 20 Mar 2014, 17:13:29

D'oh! I finally figured out why I couldn't reproduce this.. if you install it as a package, all is well. But then, when you publish the homepage it breaks. So I've FINALLY updated the starter kit so that new installs won't have this problem.


Sebastiaan Janssen 20 Mar 2014, 17:13:57

And yes, just changed @Umbraco.Content(CurrentPage.BannerLink).Url to @Umbraco.Content(CurrentPage.BannerLink.ToString()).Url


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.0.0

Due in version:

Sprint:

Story Points:

Cycle: