mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Fixing #17515: Can't enable Indexing module in the features section of a recipe
This was cause1d by a bug in the DefaultIndexingUpdater that was processing all feature enabled events instead of just processing the feature enabled event for the Orchard.Indexing feature. The code in that file is also obsolete and is not needed anymore. --HG-- branch : 1.x
This commit is contained in:
@@ -1,47 +0,0 @@
|
||||
using Orchard.Environment;
|
||||
using Orchard.Environment.Extensions.Models;
|
||||
using Orchard.Tasks.Indexing;
|
||||
using Orchard.ContentManagement;
|
||||
|
||||
namespace Orchard.Indexing {
|
||||
public class DefaultIndexingUpdater : IFeatureEventHandler {
|
||||
private readonly IIndexingTaskManager _indexingTaskManager;
|
||||
private readonly IContentManager _contentManager;
|
||||
|
||||
public DefaultIndexingUpdater (IIndexingTaskManager indexingTaskManager, IContentManager contentManager){
|
||||
_indexingTaskManager = indexingTaskManager;
|
||||
_contentManager = contentManager;
|
||||
}
|
||||
|
||||
public void Installing(Feature feature) {
|
||||
}
|
||||
|
||||
public void Installed(Feature feature) {
|
||||
}
|
||||
|
||||
public void Enabling(Feature feature) {
|
||||
}
|
||||
|
||||
public void Enabled(Feature feature) {
|
||||
// create indexing tasks for all currently existing content, even when the module is enabled again
|
||||
// as some content might have been created while this module was not active, and indexing tasks
|
||||
// would not exist for them, resulting in an uncomplete index.
|
||||
|
||||
foreach (var contentItem in _contentManager.Query(VersionOptions.Published).List()) {
|
||||
_indexingTaskManager.CreateUpdateIndexTask(contentItem);
|
||||
}
|
||||
}
|
||||
|
||||
public void Disabling(Feature feature) {
|
||||
}
|
||||
|
||||
public void Disabled(Feature feature) {
|
||||
}
|
||||
|
||||
public void Uninstalling(Feature feature) {
|
||||
}
|
||||
|
||||
public void Uninstalled(Feature feature) {
|
||||
}
|
||||
}
|
||||
}
|
@@ -52,7 +52,6 @@
|
||||
<Compile Include="Commands\IndexingCommands.cs" />
|
||||
<Compile Include="Controllers\AdminController.cs" />
|
||||
<Compile Include="Migrations.cs" />
|
||||
<Compile Include="DefaultIndexingUpdater.cs" />
|
||||
<Compile Include="Handlers\CreateIndexingTaskHandler.cs" />
|
||||
<Compile Include="Handlers\InfosetFieldIndexingHandler.cs" />
|
||||
<Compile Include="Models\IndexingTask.cs" />
|
||||
|
Reference in New Issue
Block a user