Closed cpaterra closed 7 years ago
On DNN 07.03.04 (45) as well as on Evoq Engage 08.01.00 (492) the list of previously entered categories do not show at all, and because of that (I assume) cannot be edited, deleted or re-rordered. Tested on Firefox and Chrome.
The category tree view doesn't like the nullable int for FaqCategoryParentId. I downloaded the source for 5.1.1, and put a hack in bindData that allowed it to work for me. I defined a similar catInfo class with FaqCategoryParentId defined as int instead of int?. Loop thorugh the iList returned from ListCategoriesHierarchical, newing my class, filling in the data and setting FaqCategoryParentId to Null.NullInt when its null. And then assign my new list as the DataSource. Ugly but works until the real fix is released.
The redinfined code section is {code} public class catInfo { public int FaqCategoryParentId { get; set; } public int FaqCategoryId { get; set; } public int ModuleId { get; set; } public string FaqCategoryName { get; set; } public string FaqCategoryDescription { get; set; } public int Level { get; set; } public int ViewOrder { get; set; }
public catInfo()
{
}
}
#region Private Methods
private void BindData()
{
FAQsController FAQsController = new FAQsController();
IEnumerable<CategoryInfo> cats = FAQsController.ListCategoriesHierarchical(ModuleId, false);
ArrayList lst = new ArrayList();
foreach (CategoryInfo cat in cats)
{
catInfo cinfo = new catInfo()
{
FaqCategoryParentId = cat.FaqCategoryParentId.HasValue ? cat.FaqCategoryParentId.Value : -1,
FaqCategoryId = cat.FaqCategoryId,
ModuleId = cat.ModuleId,
FaqCategoryName = cat.FaqCategoryName,
FaqCategoryDescription = cat.FaqCategoryDescription,
Level = cat.Level,
ViewOrder = cat.ViewOrder
};
lst.Add(cinfo);
}
treeCategories.Nodes.Clear();
treeCategories.DataTextField = "FaqCategoryName";
treeCategories.DataFieldID = "FaqCategoryId";
treeCategories.DataFieldParentID = "FaqCategoryParentId";
treeCategories.DataSource = lst;
treeCategories.DataBind();
if (!IsPostBack && treeCategories.Nodes.Count > 0)
treeCategories.Nodes[0].Selected = true;
}
{code}
@swkuhn Can you create a pull request with a bug fix?
yes. We are doing a production release middle of night tomorrow, will be after that.
Scott
pull request created.
Great! I will review and merge when I am back home from holiday.
Merged
Once a category is created the name cannot be changed.
In Dnn 8.0 install the DNN FAQ extension from Host --> Extensions --> Available Extensions Add the FAQ module to a page. Create a new category. There is no option to rename the category created.
Expected Result: An option to rename a created category.