Unable to add tools to sites created from some templates
|Participant||Role||Time Spent||Comments||Latest Comment|
|Author||25m||1||Placeholder for my changes; will clean that up.|
|Reviewer - Complete||5m||2||Patch looks good. I only have a question on one comment|
|Reviewer - Complete||7m|
|Reviewer - 0% reviewed||0m|
1) the list of tools displayed the tool selection list depends on the siteType. When a template or site created from a template is a non-core type (i.e. 'specialized_courses' or 'affiliation' vs 'course') then the type is unknown to the tool selection code (see SiteAction.orderToolIds, SiteAction.getTools, SiteAction.setToolRegistrationList and SiteAction.doSite_type) and all tools go into the unsorted or 'Not Grouped' list.
2) A final check of selected tools (chosenList) is checked against the siteType deep within SiteAction.saveFeatures; if a tool is not found to be in the set defined by the site type it's not added to the list of tools valid for that site type (ToolManager.findTools(categories).
To solve both issues, I've added SiteTypeUtils.getTargetSiteType() to return the base type of the template's site type; (i.e. an 'affiliation' is a type of 'course' - see UMICH-798). Using this base type the proper list of tools will always be selected for display (in #1 above) and when the site is saved (#2 above).
I also did a tiny bit of refactoring to getUngroupedTools - removing an unused parameter.
Branches in review
Issues Raised From Comments