Updated Tag Cloud (v1.1)

Topics: General/Misc.
Feb 4, 2008 at 6:56 AM
In the version 1.1. Tag Cloud there's a minor bug. In SPTagCloud.cs the following code needs to be modified:

protected ArrayList GetTags()
{
Hashtable ht = new Hashtable();
ArrayList al = new ArrayList();
TextInfo ti = CultureInfo.CurrentCulture.TextInfo;

SPWeb mySite = SPControl.GetContextWeb(Context);

GetTagsFromWeb(ti, mySite, ref ht, ref al);

al.Sort();
return al;
SPWeb.Dispose();

}

The correct code is:

protected ArrayList GetTags()
{
Hashtable ht = new Hashtable();
ArrayList al = new ArrayList();
TextInfo ti = CultureInfo.CurrentCulture.TextInfo;

using (SPWeb mySite = SPControl.GetContextWeb(Context))
{

GetTagsFromWeb(ti, mySite, ref ht, ref al);

al.Sort();

}
return al;
}