Skip to content

Commit

Permalink
DNN-9299: Fixed localized page publishing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Kan Ma authored and zyhfish committed Feb 10, 2017
1 parent dd50a0a commit bbd5dcc
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
21 changes: 17 additions & 4 deletions DNN Platform/Library/Entities/Modules/ModuleController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -652,8 +652,10 @@ private int LocalizeModuleInternal(ModuleInfo sourceModule)
newModule.CultureCode,
currentUser.UserID);

//Copy each setting to the new TabModule instance
foreach (DictionaryEntry setting in settings)
DataCache.RemoveCache(string.Format(DataCache.SingleTabModuleCacheKey, newModule.TabModuleID));

//Copy each setting to the new TabModule instance
foreach (DictionaryEntry setting in settings)
{
UpdateModuleSetting(newModule.ModuleID, Convert.ToString(setting.Key), Convert.ToString(setting.Value));
}
Expand Down Expand Up @@ -831,7 +833,8 @@ private void DeleteTabModuleInternal(ModuleInfo moduleInfo, bool softDelete, boo
//hard delete the module
DeleteModule(moduleInfo.ModuleID);
}


DataCache.RemoveCache(string.Format(DataCache.SingleTabModuleCacheKey, moduleInfo.TabModuleID));
ClearCache(moduleInfo.TabID);
}
}
Expand Down Expand Up @@ -1345,6 +1348,13 @@ public int DeLocalizeModule(ModuleInfo sourceModule)
newModule.CultureCode,
UserController.Instance.GetCurrentUserInfo().UserID);

DataCache.RemoveCache(string.Format(DataCache.SingleTabModuleCacheKey, newModule.TabModuleID));

//Update tab version details of old and new modules
var userId = UserController.Instance.GetCurrentUserInfo().UserID;
TabChangeTracker.Instance.TrackModuleDeletion(sourceModule, Null.NullInteger, userId);
TabChangeTracker.Instance.TrackModuleCopy(newModule, Null.NullInteger, newModule.TabID, userId);

//check if all modules instances have been deleted
if (GetModule(sourceModule.ModuleID, Null.NullInteger, true).TabID == Null.NullInteger)
{
Expand Down Expand Up @@ -1888,6 +1898,8 @@ public void UpdateModule(ModuleInfo module)
module.CultureCode,
currentUser.UserID);

DataCache.RemoveCache(string.Format(DataCache.SingleTabModuleCacheKey, module.TabModuleID));

EventLogController.Instance.AddLog(module, PortalController.Instance.GetCurrentPortalSettings(), currentUser.UserID, "", EventLogController.EventLogType.TABMODULE_UPDATED);

if (hasModuleOrderOrPaneChanged)
Expand Down Expand Up @@ -1963,7 +1975,8 @@ public void UpdateModule(ModuleInfo module)
targetModule.CultureCode,
currentUser.UserID);

ClearCache(targetModule.TabID);
DataCache.RemoveCache(string.Format(DataCache.SingleTabModuleCacheKey, targetModule.TabModuleID));
ClearCache(targetModule.TabID);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,14 @@ private static void ProcessDeletionDetail(ModuleInfo module, int moduleVersion,
}
}

var tabVersionDetail = CreateNewTabVersionDetailObjectFromModule(targetVersion.TabVersionId, module,
moduleVersion, TabVersionDetailAction.Deleted);
TabVersionDetailController.Instance.SaveTabVersionDetail(tabVersionDetail, userId);

//Do not add module to Tab Version Details if it has been hard deleted
ModuleInfo moduleInfo = ModuleController.Instance.GetModule(module.ModuleID, module.TabID, false);
if (moduleInfo != null)
{
var tabVersionDetail = CreateNewTabVersionDetailObjectFromModule(targetVersion.TabVersionId, module,
moduleVersion, TabVersionDetailAction.Deleted);
TabVersionDetailController.Instance.SaveTabVersionDetail(tabVersionDetail, userId);
}
}

private static bool IsHostModule(ModuleInfo module)
Expand Down

0 comments on commit bbd5dcc

Please # to comment.