Copied to clipboard

Flag this post as spam?

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


  • Stephen Dougherty 23 posts 45 karma points
    Dec 07, 2014 @ 23:45
    Stephen Dougherty
    0

    Umbraco 7.2 error at GetGridHtml

    Hi I have been trying to play around with the great new grid feature in 7.2. I have tried with a brand new site with no issues but unfortunately with an existing site I have a copy of running locally and successfully upgraded I get the below error when hitting GetGridHtml(). Searching elsewhere I guess it is something to do with references I have but perhaps some of you helpful guys can help me out.

    ERROR Umbraco.Core.Dynamics.DynamicInstanceHelper - [Thread 19] An error occurred finding and executing extension method "GetGridHtml" for type "Umbraco.Web.Models.DynamicPublishedContent". Types searched for extension methods were Umbraco.Web.Models.DynamicPublishedContent.
    System.TypeInitializationException: The type initializer for 'Umbraco.Core.Dynamics.ExtensionMethodFinder' threw an exception. ---> System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
    at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
    at System.Reflection.RuntimeModule.GetTypes()
    at System.Reflection.Assembly.GetTypes()
    at Umbraco.Core.Dynamics.ExtensionMethodFinder.<.cctor>b__1(Assembly a)
    at System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
    at System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
    at System.Linq.Enumerable.<ConcatIterator>d__71`1.MoveNext()
    at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
    at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
    at Umbraco.Core.Dynamics.ExtensionMethodFinder..cctor()
    --- End of inner exception stack trace ---
    at Umbraco.Core.Dynamics.ExtensionMethodFinder.FindExtensionMethod(Type thisType, Object[] args, String name, Boolean argsContainsThis)
    at Umbraco.Core.Dynamics.DynamicInstanceHelper.FindAndExecuteExtensionMethod[T](T thisObject, Object[] args, String name, IEnumerable`1 findMethodsOnTypes)
    at Umbraco.Core.Dynamics.DynamicInstanceHelper.TryInvokeMember[T](T thisObject, InvokeMemberBinder binder, Object[] args, IEnumerable`1 findExtensionMethodsOnTypes)

    Thanks,

    Stephen

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Dec 08, 2014 @ 06:03
    Jan Skovgaard
    0

    Hi Stephen

    What version did you upgrade from? And how did you perform the upgrade?

    Did you try clearing the umbraco cache and rebulding the examine indexes after the upgrade was done? If not then please try doing it.

    1: Go go the /app_data/TEMP/ folder and delete the content of the "ExamineIndexes" folder and the "ClientDepedency" folder 2: Go to the /config/ClientDependency.config folder and increment the version attribute 3: Recycle the app pool

    Then go into the backoffice and click on the "Developer" section and go into the Examine dashboard to the upper right and choose to rebuild the index.

    Does that help any?

    /Jan

  • Phillip Ng 148 posts 250 karma points
    Dec 12, 2014 @ 21:55
    Phillip Ng
    0

    I am running into a problem outputting the contents of the Grid datatype as well. Though I am not getting an error, nothing gets rendered on the front-end. I upgraded from 6.1 manually, created the data type, and implemented it on a new doc type. When i use CurrentPage.grid, the JSON is returned, but when using CurrentPage.GetGridHtml("grid"), nothing is outputted. I noticed earlier that the /Views/Partial/ folder did not contain a Grid directory, so I added that in, and even after following your advice, Jan, still nothing. Am i possibly missing some other references or files? Thanks in advance

  • Stephen Dougherty 23 posts 45 karma points
    Dec 13, 2014 @ 00:20
    Stephen Dougherty
    0

    Hi Jan,

    Thanks for the advice and sorry about the delay in trying this. I upgraded from version 7.1.8 and did this manually with the 7.2 zip file and I have a VS solution.

    Unfortunately this did not help. I am not sure what is going on here.

    Regards,

    Stephen

  • Phillip Ng 148 posts 250 karma points
    Dec 17, 2014 @ 19:23
    Phillip Ng
    0

    I ended up installing a clean verson of 7.2 and the GetGridHtml() method worked. We must be missing something in the upgrade.

  • Stephen Dougherty 23 posts 45 karma points
    Dec 20, 2014 @ 01:34
    Stephen Dougherty
    0

    Hi Phillip,

    Yes I just upgraded the live site and getting the same error. Something obviously missing but what?

    I will investigate further.

    Stephen

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Dec 20, 2014 @ 05:53
    Jan Skovgaard
    0

    Hi Guys

    Have you merged the /config/ files folder as well? And have you made sure to merge the web.config too - Can't remember if there are any changes between versions though but always good to check if you're upgrading from and older major version.

    Looking forward to hearing more from you guys and sorry for the late response - totally missed this one.

    /Jan

  • Stephen Dougherty 23 posts 45 karma points
    Dec 24, 2014 @ 13:23
    Stephen Dougherty
    0

    Hi Jan,

     

    Yes I merged both with WinMerge.

     

    Stephen

  • Stephen Dougherty 23 posts 45 karma points
    Jan 04, 2015 @ 02:20
    Stephen Dougherty
    1

    Just for completeness I wanted to update this thread. I went through a local copy of my existing site that the grid would not show for and started removing packages/dlls. I finally stumbled across the offender. Google.Apis.Auth.Mvc4.dll which is installed with the Umbraco Analytics package. When I removed this from my bin folder the grid appeared. I'm still not sure what is going on here but from other threads can see that this is not even used by the Analytics package. Perhaps someone can confirm this?

    Stephen

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jan 07, 2015 @ 09:37
    Jan Skovgaard
    0

    Hi Stephen

    Sorry about the late reply, holidays and the flu happened :) Glad you figured out what was the culprit and thanks for sharing.

    Perhaps you can also ask Warren and Tim by posting the question as an issue on GitHub here https://github.com/warrenbuckley/Analytics

    /Jan

  • Stephen Dougherty 23 posts 45 karma points
    Jan 08, 2015 @ 01:38
    Stephen Dougherty
    0

    Hi Jan,

    No problem, I sympathise with similar things happening :)

    I will indeed ask Warren and Tim about this.

    Stephen

  • Kristian Ravnevand 94 posts 214 karma points
    Jan 27, 2015 @ 15:21
    Kristian Ravnevand
    0

    I to ran into this issue, for me I had to delete DDay.iCal and DDay.Collection.dll, so it seems to be an issue with GetGridHtml combined with other dll's

  • Sunnefa Lind 29 posts 85 karma points
    Jan 27, 2015 @ 16:42
    Sunnefa Lind
    0

    I'm having this same issue but I can't find the offending dll file. Is there any other fixes for this that anyone knows about? I upgraded from 7.1.8 and I've uninstalled all packages and thrown away any dlls that might have been possible offenders so I have a pretty barebones installation so I'm at the end of my rope here... Any help would be greatly appreciated :-)

  • Sunnefa Lind 29 posts 85 karma points
    Jan 28, 2015 @ 15:02
    Sunnefa Lind
    4

    Followup:

    Okay so apparently I was using what was stated in the documentation: @CurrentPage.GetGridHtml("grid") and that failed but as soon as I switched to @Model.Content.GetGridHtml("grid") it worked fine... I'm not sure if this is a bug in Umbraco or if it's got something to do with my setup... Should I submit an issue on the issue tracker for this?

  • Kristian Ravnevand 94 posts 214 karma points
    Jan 28, 2015 @ 15:13
    Kristian Ravnevand
    0

    Sunnefa, tested your solution on my project to, and the error is gone without removing any dll's. :-)

  • Stephen Dougherty 23 posts 45 karma points
    Jan 28, 2015 @ 15:17
    Stephen Dougherty
    1

    Hi Sunnefa,

    I believe (may be wrong) that you switched to a strongly typed call for the grid instead of @CurrentPage which is dynamic and because the rest of your page is strongly typed then this allowed the grid to be rendered.

    This link explains the differences in more detail.

    http://stackoverflow.com/questions/26141862/umbraco-7-when-to-use-umbraco-vs-currentpage-vs-model-in-razor-views

    Thanks,

    Stephen

  • Rune Hem Strand 147 posts 911 karma points hq c-trib
    Jan 28, 2015 @ 15:58
    Rune Hem Strand
    0

    @Sunnefa Great you got it working. No need to submit an issue, see @Stephens answer

    I have updated the documentation to include rendering when using strongly typed model :)

    /Rune

Please Sign in or register to post replies

Write your reply to:

Draft