Fixing widget filtering

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2012-09-28 16:12:55 -07:00
parent 7281178afb
commit 5c1cc397ce
3 changed files with 6 additions and 5 deletions

View File

@@ -61,7 +61,7 @@ namespace Orchard.Widgets.Filters {
}
}
IEnumerable<WidgetPart> widgetParts = _widgetsService.GetWidgets(activeLayerIds.ToArray());
IEnumerable<WidgetPart> widgetParts = _widgetsService.GetWidgets(layerIds: activeLayerIds.ToArray());
// Build and add shape to zone.
var zones = workContext.Layout.Zones;

View File

@@ -21,6 +21,10 @@
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>4.0</OldToolsVersion>
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -42,7 +46,6 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="NHibernate, Version=3.3.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL" />
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">

View File

@@ -2,9 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using JetBrains.Annotations;
using NHibernate.Criterion;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Aspects;
using Orchard.Environment.Extensions;
using Orchard.Environment.Extensions.Models;
using Orchard.Environment.Features;
@@ -73,7 +71,7 @@ namespace Orchard.Widgets.Services {
public IEnumerable<WidgetPart> GetWidgets(int[] layerIds) {
return _contentManager
.Query<WidgetPart, WidgetPartRecord>()
.Where<CommonPartRecord>(x => x.Container.Id.IsIn(layerIds))
.Where<CommonPartRecord>(x => layerIds.Contains(x.Container.Id))
.WithQueryHints(new QueryHints().ExpandRecords<CommonPartRecord>())
.List();
}