Merge pull request #974 from sbwalker/dev

fix #957 related to loading resources within a Settings component
This commit is contained in:
Shaun Walker 2020-12-03 15:19:44 -05:00 committed by GitHub
commit 0ba348d73e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -484,8 +484,19 @@
// get additional metadata from IModuleControl interface
if (moduletype != null && module.ModuleType != "")
{
// retrieve module component resources
var moduleobject = Activator.CreateInstance(moduletype) as IModuleControl;
page.Resources = ManagePageResources(page.Resources, moduleobject.Resources);
if (action.ToLower() == "settings" && module.ModuleDefinition != null)
{
// settings components are embedded within a framework settings module
moduletype = Type.GetType(module.ModuleDefinition.ControlTypeTemplate.Replace(Constants.ActionToken, action), false, true);
if (moduletype != null)
{
moduleobject = Activator.CreateInstance(moduletype) as IModuleControl;
page.Resources = ManagePageResources(page.Resources, moduleobject.Resources);
}
}
// additional metadata needed for admin components
if (module.ModuleId == moduleid && action != "")