do not display audit info when copying pages

This commit is contained in:
sbwalker
2026-02-25 09:46:05 -05:00
parent 06e555ddd1
commit 00d14552b1
2 changed files with 41 additions and 26 deletions

View File

@@ -225,7 +225,10 @@
<button type="button" class="btn btn-secondary" @onclick="Cancel">@SharedLocalizer["Cancel"]</button>
<br />
<br />
@if (!_copy)
{
<AuditInfo CreatedBy="@_createdby" CreatedOn="@_createdon" ModifiedBy="@_modifiedby" ModifiedOn="@_modifiedon" DeletedBy="@_deletedby" DeletedOn="@_deletedon"></AuditInfo>
}
</TabPanel>
<TabPanel Name="Permissions" ResourceKey="Permissions" Heading="Permissions">
<div class="container">

View File

@@ -513,7 +513,13 @@ namespace Oqtane.Controllers
List<PageModule> pageModules = _pageModules.GetPageModules(fromPage.SiteId).ToList();
foreach (PageModule pm in pageModules.Where(item => item.PageId == fromPage.PageId && !item.Module.AllPages && !item.IsDeleted))
{
Module module = new Module();
Module module;
// determine if module is a shared instance (ie. exists on other pages)
if (!pageModules.Any(item => item.ModuleId == pm.ModuleId && item.PageId != fromPage.PageId))
{
// create new module
module = new Module();
module.SiteId = fromPage.SiteId;
module.PageId = toPageId;
module.ModuleDefinitionName = pm.Module.ModuleDefinitionName;
@@ -536,13 +542,19 @@ namespace Oqtane.Controllers
UserId = item.UserId,
IsAuthorized = item.IsAuthorized,
}).ToList();
module = _modules.AddModule(module);
module = _modules.AddModule(module);
string content = _modules.ExportModule(pm.ModuleId);
if (content != "")
{
_modules.ImportModule(module.ModuleId, content);
}
}
else
{
// use existing module
module = pm.Module;
}
PageModule pageModule = new PageModule();
pageModule.PageId = toPageId;