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)
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.
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
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.
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.
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?
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
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 :-)
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?
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.
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.
Thanks,
Stephen
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
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
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
I ended up installing a clean verson of 7.2 and the GetGridHtml() method worked. We must be missing something in the upgrade.
Hi Phillip,
Yes I just upgraded the live site and getting the same error. Something obviously missing but what?
I will investigate further.
Stephen
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
Hi Jan,
Yes I merged both with WinMerge.
Stephen
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
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
Hi Jan,
No problem, I sympathise with similar things happening :)
I will indeed ask Warren and Tim about this.
Stephen
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
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 :-)
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?Sunnefa, tested your solution on my project to, and the error is gone without removing any dll's. :-)
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
@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
is working on a reply...