diff --git a/Oqtane.Server/Managers/Search/ModuleSearchIndexManager.cs b/Oqtane.Server/Managers/Search/ModuleSearchIndexManager.cs index f1e65614..4764647e 100644 --- a/Oqtane.Server/Managers/Search/ModuleSearchIndexManager.cs +++ b/Oqtane.Server/Managers/Search/ModuleSearchIndexManager.cs @@ -49,17 +49,16 @@ namespace Oqtane.Managers.Search continue; } - var module = pageModule.Module; - if (module.ModuleDefinition != null && module.ModuleDefinition.ServerManagerType != "") + if (pageModule.Module.ModuleDefinition != null && pageModule.Module.ModuleDefinition.ServerManagerType != "") { - _logger.LogDebug($"Search: Begin index module {module.ModuleId}."); - var type = Type.GetType(module.ModuleDefinition.ServerManagerType); + _logger.LogDebug($"Search: Begin index module {pageModule.ModuleId}."); + var type = Type.GetType(pageModule.Module.ModuleDefinition.ServerManagerType); if (type?.GetInterface(nameof(ISearchable)) != null) { try { var moduleSearch = (ISearchable)ActivatorUtilities.CreateInstance(_serviceProvider, type); - var contentList = moduleSearch.GetSearchContents(module, startTime.GetValueOrDefault(DateTime.MinValue)); + var contentList = moduleSearch.GetSearchContents(pageModule, startTime.GetValueOrDefault(DateTime.MinValue)); if(contentList != null) { foreach(var searchContent in contentList) @@ -73,11 +72,11 @@ namespace Oqtane.Managers.Search } catch(Exception ex) { - _logger.LogError(ex, $"Search: Index module {module.ModuleId} failed."); - handleError($"Search: Index module {module.ModuleId} failed: {ex.Message}"); + _logger.LogError(ex, $"Search: Index module {pageModule.ModuleId} failed."); + handleError($"Search: Index module {pageModule.ModuleId} failed: {ex.Message}"); } } - _logger.LogDebug($"Search: End index module {module.ModuleId}."); + _logger.LogDebug($"Search: End index module {pageModule.ModuleId}."); } } diff --git a/Oqtane.Server/Modules/HtmlText/Manager/HtmlTextManager.cs b/Oqtane.Server/Modules/HtmlText/Manager/HtmlTextManager.cs index 7b5ecced..305fa22d 100644 --- a/Oqtane.Server/Modules/HtmlText/Manager/HtmlTextManager.cs +++ b/Oqtane.Server/Modules/HtmlText/Manager/HtmlTextManager.cs @@ -48,18 +48,18 @@ namespace Oqtane.Modules.HtmlText.Manager return content; } - public List GetSearchContents(Module module, DateTime startDate) + public List GetSearchContents(PageModule pageModule, DateTime startDate) { var searchContentList = new List(); - var htmltexts = _htmlText.GetHtmlTexts(module.ModuleId); + var htmltexts = _htmlText.GetHtmlTexts(pageModule.ModuleId); if (htmltexts != null && htmltexts.Any(i => i.CreatedOn >= startDate)) { var htmltext = htmltexts.OrderByDescending(item => item.CreatedOn).First(); searchContentList.Add(new SearchContent { - Title = module.Title, + Title = pageModule.Module.Title, Description = string.Empty, Body = htmltext.Content, ContentModifiedBy = htmltext.ModifiedBy, diff --git a/Oqtane.Shared/Interfaces/ISearchable.cs b/Oqtane.Shared/Interfaces/ISearchable.cs index 35019c01..33f81d51 100644 --- a/Oqtane.Shared/Interfaces/ISearchable.cs +++ b/Oqtane.Shared/Interfaces/ISearchable.cs @@ -6,6 +6,6 @@ namespace Oqtane.Interfaces { public interface ISearchable { - public List GetSearchContents(Module module, DateTime startTime); + public List GetSearchContents(PageModule pageModule, DateTime startTime); } }