2 Replies Latest reply on Aug 1, 2016 11:25 PM by lars.kreisz

    ClassCastException in RecentContentWidget on SocialGroup overview page

    lars.kreisz

      Hey Jivers,

       

      i found a strange behavior when placing the recent content widget on a social group overview page. When there's enough content to be listed, the "more" button is shown. But if i click it, the result is empty and no new items are appended. In the logs i found this:

       

      2016-08-01 11:24:21,538 [http-nio-127.0.0.1-9001-exec-11] [4806:larskreisz:REGULAR] ERROR freemarker.runtime - Error executing FreeMarker template FreeMarker template error: The following has evaluated to null or missing: ==> widgetContext  [in template "template/widget/more-content-results.ftl" at line 5, column 44] ---- Tip: If the failing expression is known to be legally refer to something that's null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only co ver the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related):         - Faild at: @jive.jiveContentListAjax currentUser...  [in template "template/widget/more-content-results.ftl" at line 5, column 5] ----

       

      The widgetContext calls the RecentUpdatesAction's getWidgetContext()-Method that is inherited from CommunityActionSupport. Here's the trouble as this method casts the result of getContainer() to Community although it's a SocialGroup as we placed the widget on a social group overview page.

       

      Dropping in the code of PlaceActionSupport.getWidgetContext() which handles the differences fixes the problem for me.

       

      Am i running into a jive bug here?

       

      Regards,

      Lars.