mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#21257: Fixed empty snippets menu item issue.
The issue was that the snippets harvester included the Elements_Snippet shape which itself is not a snippet. This also fixes an issue where it would not find snippets defined in the current theme.
This commit is contained in:
@@ -40,7 +40,7 @@ namespace Orchard.Layouts.Providers {
|
||||
public IEnumerable<ElementDescriptor> HarvestElements(HarvestElementsContext context) {
|
||||
var currentThemeName = _siteThemeService.Value.GetCurrentThemeName();
|
||||
var shapeTable = _shapeTableLocator.Value.Lookup(currentThemeName);
|
||||
var shapeDescriptors = shapeTable.Descriptors.Where(x => x.Key.EndsWith(SnippetShapeSuffix, StringComparison.OrdinalIgnoreCase)).ToDictionary(x => x.Key, x => x.Value);
|
||||
var shapeDescriptors = shapeTable.Bindings.Where(x => !String.Equals(x.Key, "Elements_Snippet", StringComparison.OrdinalIgnoreCase) && x.Key.EndsWith(SnippetShapeSuffix, StringComparison.OrdinalIgnoreCase)).ToDictionary(x => x.Key, x => x.Value.ShapeDescriptor);
|
||||
var elementType = typeof (Snippet);
|
||||
var snippetElement = _elementFactory.Value.Activate(elementType);
|
||||
|
||||
|
Reference in New Issue
Block a user