Thursday, February 2, 2012

BUG - Recommended Content widget does not honor configuration filter checkbox options in Telligent Community Server 6.0

I recently un-covered a bug in one of the out of the box widgets in Community Server 6.0 (6.0.119.19092). The Widget is the "Recommended Content Widget".

The Problem: 
Recommended content widget was not honoring the checkboxes to limit the post types to display.

$core_v2_widget.GetCustomValue('contentType',''))  was returning a comma separated list of the selected values in widget configuration and the out of the box widget script was expecting a query string.

The Solution:

This is the original code from the out of the box widget:
#set ($contentTypes = $core_v2_page.ParseQueryString($core_v2_widget.GetCustomValue('contentType','')).Values('Selection'))

Here is code that will fix the problem:

#set ($contentString = $core_v2_widget.GetCustomValue('contentType',''))
#set ($contentTypes = $core_v2_utility.Split(",", $contentString))

By recognizing the widget is returning a comma separated string, the widget will now apply the correct filters to the query.

No comments:

Post a Comment