mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 10:56:56 +08:00
Merge branch '1.10.x' into issue/8684
# Conflicts: # .github/workflows/compile.yml # src/Orchard.Azure/Orchard.Azure.Web/Orchard.Azure.Web.csproj # src/Orchard.Azure/Orchard.Azure.Web/packages.config # src/Orchard.Specs/Blogs.feature.cs # src/Orchard.Specs/DateTime.feature # src/Orchard.Specs/DateTime.feature.cs # src/Orchard.Specs/Hosting/Orchard.Web/Web.config # src/Orchard.Web/Modules/Orchard.Localization/Handlers/LocalizationPartHandler.cs # src/Orchard.Web/Web.config # src/Orchard.sln
This commit is contained in:
commit
642a07f301
19
.github/workflows/compile.yml
vendored
19
.github/workflows/compile.yml
vendored
@ -2,6 +2,11 @@ name: Compile
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- 1.10.x
|
||||
|
||||
jobs:
|
||||
compile:
|
||||
@ -22,19 +27,7 @@ jobs:
|
||||
uses: microsoft/setup-msbuild@v1.3.1
|
||||
|
||||
- name: Compile
|
||||
run: msbuild Orchard.proj /m /t:Compile /p:MvcBuildViews=true /p:TreatWarningsAsErrors=true -WarnAsError /bl:Orchard.binlog
|
||||
|
||||
- name: Upload MSBuild Binary Log
|
||||
uses: actions/upload-artifact@v3.1.1
|
||||
if: success() || failure()
|
||||
with:
|
||||
name: Orchard-${{ github.sha }}-${{ github.run_number }}.binlog
|
||||
path: Orchard.binlog
|
||||
if-no-files-found: ignore
|
||||
run: msbuild Orchard.proj /m /t:Compile /p:MvcBuildViews=true /p:TreatWarningsAsErrors=true -WarnAsError
|
||||
|
||||
- name: Test
|
||||
run: msbuild Orchard.proj /m /t:Test
|
||||
|
||||
- name: Spec
|
||||
if: false
|
||||
run: msbuild Orchard.proj /m /t:Spec
|
||||
|
@ -165,7 +165,7 @@
|
||||
<NUnit Assemblies="@(TestAssemblies)" ToolPath="@(NUnitPackageToolsFolder)" WorkingDirectory="$(CompileFolder)" OutputXmlFile="$(BuildFolder)\Orchard.Tests.xml" ExcludeCategory="longrunning" />
|
||||
</Target>
|
||||
|
||||
<Target Name="Spec" DependsOnTargets="Package-Stage">
|
||||
<Target Name="Spec" DependsOnTargets="Compile">
|
||||
<!-- Running SpecFlow tests -->
|
||||
<CreateItem Include="$(CompileFolder)\*.Specs.*dll">
|
||||
<Output TaskParameter="Include" ItemName="SpecAssemblies" />
|
||||
|
@ -177,7 +177,7 @@ namespace Orchard.Core.Tests.Common.Providers {
|
||||
contentManager.UpdateEditor(item.ContentItem, updateModel.Object);
|
||||
}
|
||||
|
||||
class UpdatModelStub : IUpdateModel {
|
||||
class UpdateModelStub : IUpdateModel {
|
||||
|
||||
ModelStateDictionary _modelState = new ModelStateDictionary();
|
||||
|
||||
@ -215,11 +215,11 @@ namespace Orchard.Core.Tests.Common.Providers {
|
||||
|
||||
var user = contentManager.New<IUser>("User");
|
||||
_authn.Setup(x => x.GetAuthenticatedUser()).Returns(user);
|
||||
_authz.Setup(x => x.TryCheckAccess(StandardPermissions.SiteOwner, user, item)).Returns(true);
|
||||
_authz.Setup(x => x.TryCheckAccess(OwnerEditorPermissions.MayEditContentOwner, user, item)).Returns(true);
|
||||
|
||||
item.Owner = user;
|
||||
|
||||
var updater = new UpdatModelStub() { Owner = null };
|
||||
var updater = new UpdateModelStub() { Owner = null };
|
||||
|
||||
contentManager.UpdateEditor(item.ContentItem, updater);
|
||||
}
|
||||
@ -232,11 +232,11 @@ namespace Orchard.Core.Tests.Common.Providers {
|
||||
|
||||
var user = contentManager.New<IUser>("User");
|
||||
_authn.Setup(x => x.GetAuthenticatedUser()).Returns(user);
|
||||
_authz.Setup(x => x.TryCheckAccess(StandardPermissions.SiteOwner, user, item)).Returns(true);
|
||||
_authz.Setup(x => x.TryCheckAccess(OwnerEditorPermissions.MayEditContentOwner, user, item)).Returns(true);
|
||||
|
||||
item.Owner = user;
|
||||
|
||||
var updater = new UpdatModelStub() { Owner = "" };
|
||||
var updater = new UpdateModelStub() { Owner = "" };
|
||||
|
||||
_container.Resolve<DefaultShapeTableManagerTests.TestShapeProvider>().Discover =
|
||||
b => b.Describe("Parts_Common_Owner_Edit").From(TestFeature())
|
||||
@ -255,11 +255,11 @@ namespace Orchard.Core.Tests.Common.Providers {
|
||||
|
||||
var user = contentManager.New<IUser>("User");
|
||||
_authn.Setup(x => x.GetAuthenticatedUser()).Returns(user);
|
||||
_authz.Setup(x => x.TryCheckAccess(StandardPermissions.SiteOwner, user, item)).Returns(true);
|
||||
_authz.Setup(x => x.TryCheckAccess(OwnerEditorPermissions.MayEditContentOwner, user, item)).Returns(true);
|
||||
|
||||
item.Owner = user;
|
||||
|
||||
var updater = new UpdatModelStub() { Owner = "" };
|
||||
var updater = new UpdateModelStub() { Owner = "" };
|
||||
|
||||
_container.Resolve<DefaultShapeTableManagerTests.TestShapeProvider>().Discover =
|
||||
b => b.Describe("Parts_Common_Owner_Edit").From(TestFeature())
|
||||
@ -384,7 +384,7 @@ namespace Orchard.Core.Tests.Common.Providers {
|
||||
_clock.Advance(TimeSpan.FromMinutes(1));
|
||||
var editUtc = _clock.UtcNow;
|
||||
|
||||
var updater = new UpdatModelStub() { Owner = "" };
|
||||
var updater = new UpdateModelStub() { Owner = "" };
|
||||
contentManager.UpdateEditor(item.ContentItem, updater);
|
||||
|
||||
Assert.That(item.CreatedUtc, Is.EqualTo(createUtc));
|
||||
|
@ -1,15 +1,7 @@
|
||||
using System;
|
||||
using NUnit.Framework;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Aspects;
|
||||
using Orchard.Core.Contents;
|
||||
using Orchard.Data;
|
||||
using Orchard.Security;
|
||||
using Orchard.Security.Permissions;
|
||||
using System.Linq;
|
||||
using Orchard.Localization.Services;
|
||||
using Orchard.Specs.Hosting.Orchard.Web;
|
||||
using TechTalk.SpecFlow;
|
||||
using Orchard.Localization.Services;
|
||||
using System.Linq;
|
||||
|
||||
namespace Orchard.Specs.Bindings {
|
||||
[Binding]
|
||||
@ -20,7 +12,7 @@ namespace Orchard.Specs.Bindings {
|
||||
|
||||
var webApp = Binding<WebAppHosting>();
|
||||
webApp.Host.Execute(() => {
|
||||
using ( var environment = MvcApplication.CreateStandaloneEnvironment("Default") ) {
|
||||
using (var environment = MvcApplication.CreateStandaloneEnvironment("Default")) {
|
||||
var orchardServices = environment.Resolve<IOrchardServices>();
|
||||
var cultureManager = environment.Resolve<ICultureManager>();
|
||||
|
||||
@ -30,6 +22,11 @@ namespace Orchard.Specs.Bindings {
|
||||
}
|
||||
|
||||
orchardServices.WorkContext.CurrentSite.SiteCulture = cultureName;
|
||||
|
||||
// Restarting the shell to reset the cache, because the cache entry storing the list of available
|
||||
// cultures isn't invalidated by the signal in DefaultCultureManager.ListCultures when running
|
||||
// inside the test webhost.
|
||||
MvcApplication.RestartTenant("Default");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Web;
|
||||
using Castle.Core.Logging;
|
||||
using HtmlAgilityPack;
|
||||
@ -368,6 +369,11 @@ namespace Orchard.Specs.Bindings {
|
||||
}
|
||||
}
|
||||
|
||||
[When(@"I wait ""(.*)""")]
|
||||
public void WhenIWait(int waitMilliseconds) {
|
||||
Thread.Sleep(waitMilliseconds);
|
||||
}
|
||||
|
||||
[Then(@"the status should be (.*) ""(.*)""")]
|
||||
public void ThenTheStatusShouldBe(int statusCode, string statusDescription) {
|
||||
Assert.That(Details.StatusCode, Is.EqualTo(statusCode));
|
||||
|
@ -171,6 +171,7 @@ Scenario: I can create browse blog posts on several pages
|
||||
And I go to "admin/blogs"
|
||||
And I follow "My Blog"
|
||||
And I follow "New Post" where class name has "primaryAction"
|
||||
And I wait "1000"
|
||||
And I fill in
|
||||
| name | value |
|
||||
| Title.Title | My Post 1 |
|
||||
@ -179,6 +180,7 @@ Scenario: I can create browse blog posts on several pages
|
||||
And I go to "admin/blogs"
|
||||
And I follow "My Blog"
|
||||
And I follow "New Post" where class name has "primaryAction"
|
||||
And I wait "1000"
|
||||
And I fill in
|
||||
| name | value |
|
||||
| Title.Title | My Post 2 |
|
||||
@ -187,6 +189,7 @@ Scenario: I can create browse blog posts on several pages
|
||||
And I go to "admin/blogs"
|
||||
And I follow "My Blog"
|
||||
And I follow "New Post" where class name has "primaryAction"
|
||||
And I wait "1000"
|
||||
And I fill in
|
||||
| name | value |
|
||||
| Title.Title | My Post 3 |
|
||||
@ -195,6 +198,7 @@ Scenario: I can create browse blog posts on several pages
|
||||
And I go to "admin/blogs"
|
||||
And I follow "My Blog"
|
||||
And I follow "New Post" where class name has "primaryAction"
|
||||
And I wait "1000"
|
||||
And I fill in
|
||||
| name | value |
|
||||
| Title.Title | My Post 4 |
|
||||
@ -203,6 +207,7 @@ Scenario: I can create browse blog posts on several pages
|
||||
And I go to "admin/blogs"
|
||||
And I follow "My Blog"
|
||||
And I follow "New Post" where class name has "primaryAction"
|
||||
And I wait "1000"
|
||||
And I fill in
|
||||
| name | value |
|
||||
| Title.Title | My Post 5 |
|
||||
@ -211,6 +216,7 @@ Scenario: I can create browse blog posts on several pages
|
||||
And I go to "admin/blogs"
|
||||
And I follow "My Blog"
|
||||
And I follow "New Post" where class name has "primaryAction"
|
||||
And I wait "1000"
|
||||
And I fill in
|
||||
| name | value |
|
||||
| Title.Title | My Post 6 |
|
||||
@ -219,6 +225,7 @@ Scenario: I can create browse blog posts on several pages
|
||||
And I go to "admin/blogs"
|
||||
And I follow "My Blog"
|
||||
And I follow "New Post" where class name has "primaryAction"
|
||||
And I wait "1000"
|
||||
And I fill in
|
||||
| name | value |
|
||||
| Title.Title | My Post 7 |
|
||||
@ -227,6 +234,7 @@ Scenario: I can create browse blog posts on several pages
|
||||
And I go to "admin/blogs"
|
||||
And I follow "My Blog"
|
||||
And I follow "New Post" where class name has "primaryAction"
|
||||
And I wait "1000"
|
||||
And I fill in
|
||||
| name | value |
|
||||
| Title.Title | My Post 8 |
|
||||
@ -235,6 +243,7 @@ Scenario: I can create browse blog posts on several pages
|
||||
And I go to "admin/blogs"
|
||||
And I follow "My Blog"
|
||||
And I follow "New Post" where class name has "primaryAction"
|
||||
And I wait "1000"
|
||||
And I fill in
|
||||
| name | value |
|
||||
| Title.Title | My Post 9 |
|
||||
@ -243,6 +252,7 @@ Scenario: I can create browse blog posts on several pages
|
||||
And I go to "admin/blogs"
|
||||
And I follow "My Blog"
|
||||
And I follow "New Post" where class name has "primaryAction"
|
||||
And I wait "1000"
|
||||
And I fill in
|
||||
| name | value |
|
||||
| Title.Title | My Post 10 |
|
||||
@ -251,6 +261,7 @@ Scenario: I can create browse blog posts on several pages
|
||||
And I go to "admin/blogs"
|
||||
And I follow "My Blog"
|
||||
And I follow "New Post" where class name has "primaryAction"
|
||||
And I wait "1000"
|
||||
And I fill in
|
||||
| name | value |
|
||||
| Title.Title | My Post 11 |
|
||||
@ -259,6 +270,7 @@ Scenario: I can create browse blog posts on several pages
|
||||
And I go to "admin/blogs"
|
||||
And I follow "My Blog"
|
||||
And I follow "New Post" where class name has "primaryAction"
|
||||
And I wait "1000"
|
||||
And I fill in
|
||||
| name | value |
|
||||
| Title.Title | My Post 12 |
|
||||
@ -269,12 +281,12 @@ Scenario: I can create browse blog posts on several pages
|
||||
Then I should see "<h1[^>]*>.*?My Blog.*?</h1>"
|
||||
And I should see "<h1[^>]*>.*?My Post 12.*?</h1>"
|
||||
And I should see "<h1[^>]*>.*?My Post 11.*?</h1>"
|
||||
And I should not see "<h1[^>]*>.*?My Post 10.*?</h1>"
|
||||
And I should not see "My Post 2"
|
||||
When I go to "my-blog?page=2"
|
||||
Then I should see "<h1[^>]*>.*?My Blog.*?</h1>"
|
||||
And I should see "<h1[^>]*>.*?My Post 1.*?</h1>"
|
||||
And I should see "<h1[^>]*>.*?My Post 2.*?</h1>"
|
||||
And I should not see "<h1[^>]*>.*?My Post 3.*?</h1>"
|
||||
And I should not see "My Post 3"
|
||||
|
||||
Scenario: I can create a new blog with a percent sign in the title and it gets stripped out of the slug
|
||||
Given I have installed Orchard
|
||||
|
280
src/Orchard.Specs/Blogs.feature.cs
generated
280
src/Orchard.Specs/Blogs.feature.cs
generated
@ -525,6 +525,8 @@ this.ScenarioSetup(scenarioInfo);
|
||||
testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 173
|
||||
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 174
|
||||
testRunner.And("I wait \"1000\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table15 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
"name",
|
||||
@ -532,18 +534,20 @@ this.ScenarioSetup(scenarioInfo);
|
||||
table15.AddRow(new string[] {
|
||||
"Title.Title",
|
||||
"My Post 1"});
|
||||
#line 174
|
||||
#line 175
|
||||
testRunner.And("I fill in", ((string)(null)), table15, "And ");
|
||||
#line 177
|
||||
testRunner.And("I hit \"Publish\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 178
|
||||
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
testRunner.And("I hit \"Publish\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 179
|
||||
testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 180
|
||||
testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 181
|
||||
testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 182
|
||||
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 183
|
||||
testRunner.And("I wait \"1000\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table16 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
"name",
|
||||
@ -551,18 +555,20 @@ this.ScenarioSetup(scenarioInfo);
|
||||
table16.AddRow(new string[] {
|
||||
"Title.Title",
|
||||
"My Post 2"});
|
||||
#line 182
|
||||
#line 184
|
||||
testRunner.And("I fill in", ((string)(null)), table16, "And ");
|
||||
#line 185
|
||||
testRunner.And("I hit \"Publish\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 186
|
||||
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 187
|
||||
testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
testRunner.And("I hit \"Publish\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 188
|
||||
testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 189
|
||||
testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 190
|
||||
testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 191
|
||||
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 192
|
||||
testRunner.And("I wait \"1000\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table17 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
"name",
|
||||
@ -570,18 +576,20 @@ this.ScenarioSetup(scenarioInfo);
|
||||
table17.AddRow(new string[] {
|
||||
"Title.Title",
|
||||
"My Post 3"});
|
||||
#line 190
|
||||
testRunner.And("I fill in", ((string)(null)), table17, "And ");
|
||||
#line 193
|
||||
testRunner.And("I hit \"Publish\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 194
|
||||
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 195
|
||||
testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
testRunner.And("I fill in", ((string)(null)), table17, "And ");
|
||||
#line 196
|
||||
testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
testRunner.And("I hit \"Publish\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 197
|
||||
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 198
|
||||
testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 199
|
||||
testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 200
|
||||
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 201
|
||||
testRunner.And("I wait \"1000\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table18 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
"name",
|
||||
@ -589,18 +597,20 @@ this.ScenarioSetup(scenarioInfo);
|
||||
table18.AddRow(new string[] {
|
||||
"Title.Title",
|
||||
"My Post 4"});
|
||||
#line 198
|
||||
testRunner.And("I fill in", ((string)(null)), table18, "And ");
|
||||
#line 201
|
||||
testRunner.And("I hit \"Publish\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 202
|
||||
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 203
|
||||
testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 204
|
||||
testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
testRunner.And("I fill in", ((string)(null)), table18, "And ");
|
||||
#line 205
|
||||
testRunner.And("I hit \"Publish\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 206
|
||||
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 207
|
||||
testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 208
|
||||
testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 209
|
||||
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 210
|
||||
testRunner.And("I wait \"1000\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table19 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
"name",
|
||||
@ -608,18 +618,20 @@ this.ScenarioSetup(scenarioInfo);
|
||||
table19.AddRow(new string[] {
|
||||
"Title.Title",
|
||||
"My Post 5"});
|
||||
#line 206
|
||||
testRunner.And("I fill in", ((string)(null)), table19, "And ");
|
||||
#line 209
|
||||
testRunner.And("I hit \"Publish\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 210
|
||||
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 211
|
||||
testRunner.And("I fill in", ((string)(null)), table19, "And ");
|
||||
#line 214
|
||||
testRunner.And("I hit \"Publish\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 215
|
||||
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 216
|
||||
testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 212
|
||||
#line 217
|
||||
testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 213
|
||||
#line 218
|
||||
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 219
|
||||
testRunner.And("I wait \"1000\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table20 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
"name",
|
||||
@ -627,18 +639,20 @@ this.ScenarioSetup(scenarioInfo);
|
||||
table20.AddRow(new string[] {
|
||||
"Title.Title",
|
||||
"My Post 6"});
|
||||
#line 214
|
||||
testRunner.And("I fill in", ((string)(null)), table20, "And ");
|
||||
#line 217
|
||||
testRunner.And("I hit \"Publish\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 218
|
||||
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 219
|
||||
testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 220
|
||||
testRunner.And("I fill in", ((string)(null)), table20, "And ");
|
||||
#line 223
|
||||
testRunner.And("I hit \"Publish\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 224
|
||||
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 225
|
||||
testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 226
|
||||
testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 221
|
||||
#line 227
|
||||
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 228
|
||||
testRunner.And("I wait \"1000\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table21 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
"name",
|
||||
@ -646,18 +660,20 @@ this.ScenarioSetup(scenarioInfo);
|
||||
table21.AddRow(new string[] {
|
||||
"Title.Title",
|
||||
"My Post 7"});
|
||||
#line 222
|
||||
testRunner.And("I fill in", ((string)(null)), table21, "And ");
|
||||
#line 225
|
||||
testRunner.And("I hit \"Publish\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 226
|
||||
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 227
|
||||
testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 228
|
||||
testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 229
|
||||
testRunner.And("I fill in", ((string)(null)), table21, "And ");
|
||||
#line 232
|
||||
testRunner.And("I hit \"Publish\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 233
|
||||
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 234
|
||||
testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 235
|
||||
testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 236
|
||||
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 237
|
||||
testRunner.And("I wait \"1000\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table22 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
"name",
|
||||
@ -665,27 +681,8 @@ this.ScenarioSetup(scenarioInfo);
|
||||
table22.AddRow(new string[] {
|
||||
"Title.Title",
|
||||
"My Post 8"});
|
||||
#line 230
|
||||
testRunner.And("I fill in", ((string)(null)), table22, "And ");
|
||||
#line 233
|
||||
testRunner.And("I hit \"Publish\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 234
|
||||
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 235
|
||||
testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 236
|
||||
testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 237
|
||||
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table23 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
"name",
|
||||
"value"});
|
||||
table23.AddRow(new string[] {
|
||||
"Title.Title",
|
||||
"My Post 9"});
|
||||
#line 238
|
||||
testRunner.And("I fill in", ((string)(null)), table23, "And ");
|
||||
testRunner.And("I fill in", ((string)(null)), table22, "And ");
|
||||
#line 241
|
||||
testRunner.And("I hit \"Publish\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 242
|
||||
@ -696,6 +693,29 @@ this.ScenarioSetup(scenarioInfo);
|
||||
testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 245
|
||||
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 246
|
||||
testRunner.And("I wait \"1000\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table23 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
"name",
|
||||
"value"});
|
||||
table23.AddRow(new string[] {
|
||||
"Title.Title",
|
||||
"My Post 9"});
|
||||
#line 247
|
||||
testRunner.And("I fill in", ((string)(null)), table23, "And ");
|
||||
#line 250
|
||||
testRunner.And("I hit \"Publish\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 251
|
||||
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 252
|
||||
testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 253
|
||||
testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 254
|
||||
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 255
|
||||
testRunner.And("I wait \"1000\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table24 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
"name",
|
||||
@ -703,18 +723,20 @@ this.ScenarioSetup(scenarioInfo);
|
||||
table24.AddRow(new string[] {
|
||||
"Title.Title",
|
||||
"My Post 10"});
|
||||
#line 246
|
||||
#line 256
|
||||
testRunner.And("I fill in", ((string)(null)), table24, "And ");
|
||||
#line 249
|
||||
#line 259
|
||||
testRunner.And("I hit \"Publish\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 250
|
||||
#line 260
|
||||
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 251
|
||||
#line 261
|
||||
testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 252
|
||||
#line 262
|
||||
testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 253
|
||||
#line 263
|
||||
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 264
|
||||
testRunner.And("I wait \"1000\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table25 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
"name",
|
||||
@ -722,18 +744,20 @@ this.ScenarioSetup(scenarioInfo);
|
||||
table25.AddRow(new string[] {
|
||||
"Title.Title",
|
||||
"My Post 11"});
|
||||
#line 254
|
||||
#line 265
|
||||
testRunner.And("I fill in", ((string)(null)), table25, "And ");
|
||||
#line 257
|
||||
#line 268
|
||||
testRunner.And("I hit \"Publish\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 258
|
||||
#line 269
|
||||
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 259
|
||||
#line 270
|
||||
testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 260
|
||||
#line 271
|
||||
testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 261
|
||||
#line 272
|
||||
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 273
|
||||
testRunner.And("I wait \"1000\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table26 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
"name",
|
||||
@ -741,34 +765,34 @@ this.ScenarioSetup(scenarioInfo);
|
||||
table26.AddRow(new string[] {
|
||||
"Title.Title",
|
||||
"My Post 12"});
|
||||
#line 262
|
||||
testRunner.And("I fill in", ((string)(null)), table26, "And ");
|
||||
#line 265
|
||||
testRunner.And("I hit \"Publish\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 266
|
||||
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 267
|
||||
testRunner.Then("I should see \"Your Blog Post has been created.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line 268
|
||||
testRunner.When("I go to \"my-blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
||||
#line 269
|
||||
testRunner.Then("I should see \"<h1[^>]*>.*?My Blog.*?</h1>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line 270
|
||||
testRunner.And("I should see \"<h1[^>]*>.*?My Post 12.*?</h1>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 271
|
||||
testRunner.And("I should see \"<h1[^>]*>.*?My Post 11.*?</h1>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 272
|
||||
testRunner.And("I should not see \"<h1[^>]*>.*?My Post 10.*?</h1>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 273
|
||||
testRunner.When("I go to \"my-blog?page=2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
||||
#line 274
|
||||
testRunner.Then("I should see \"<h1[^>]*>.*?My Blog.*?</h1>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line 275
|
||||
testRunner.And("I should see \"<h1[^>]*>.*?My Post 1.*?</h1>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 276
|
||||
testRunner.And("I should see \"<h1[^>]*>.*?My Post 2.*?</h1>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
testRunner.And("I fill in", ((string)(null)), table26, "And ");
|
||||
#line 277
|
||||
testRunner.And("I should not see \"<h1[^>]*>.*?My Post 3.*?</h1>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
testRunner.And("I hit \"Publish\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 278
|
||||
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 279
|
||||
testRunner.Then("I should see \"Your Blog Post has been created.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line 280
|
||||
testRunner.When("I go to \"my-blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
||||
#line 281
|
||||
testRunner.Then("I should see \"<h1[^>]*>.*?My Blog.*?</h1>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line 282
|
||||
testRunner.And("I should see \"<h1[^>]*>.*?My Post 12.*?</h1>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 283
|
||||
testRunner.And("I should see \"<h1[^>]*>.*?My Post 11.*?</h1>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 284
|
||||
testRunner.And("I should not see \"My Post 2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 285
|
||||
testRunner.When("I go to \"my-blog?page=2\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
||||
#line 286
|
||||
testRunner.Then("I should see \"<h1[^>]*>.*?My Blog.*?</h1>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line 287
|
||||
testRunner.And("I should see \"<h1[^>]*>.*?My Post 1.*?</h1>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 288
|
||||
testRunner.And("I should see \"<h1[^>]*>.*?My Post 2.*?</h1>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 289
|
||||
testRunner.And("I should not see \"My Post 3\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line hidden
|
||||
this.ScenarioCleanup();
|
||||
}
|
||||
@ -780,11 +804,11 @@ this.ScenarioSetup(scenarioInfo);
|
||||
{
|
||||
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can create a new blog with a percent sign in the title and it gets stripped out" +
|
||||
" of the slug", ((string[])(null)));
|
||||
#line 279
|
||||
#line 291
|
||||
this.ScenarioSetup(scenarioInfo);
|
||||
#line 280
|
||||
#line 292
|
||||
testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
|
||||
#line 281
|
||||
#line 293
|
||||
testRunner.When("I go to \"admin/blogs/create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table27 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
@ -793,15 +817,15 @@ this.ScenarioSetup(scenarioInfo);
|
||||
table27.AddRow(new string[] {
|
||||
"Title.Title",
|
||||
"My Blog"});
|
||||
#line 282
|
||||
#line 294
|
||||
testRunner.And("I fill in", ((string)(null)), table27, "And ");
|
||||
#line 285
|
||||
#line 297
|
||||
testRunner.And("I hit \"Publish\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 286
|
||||
#line 298
|
||||
testRunner.And("I go to \"admin/blogs\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 287
|
||||
#line 299
|
||||
testRunner.And("I follow \"My Blog\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 288
|
||||
#line 300
|
||||
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table28 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
@ -813,15 +837,15 @@ this.ScenarioSetup(scenarioInfo);
|
||||
table28.AddRow(new string[] {
|
||||
"Body.Text",
|
||||
"Hi there."});
|
||||
#line 289
|
||||
#line 301
|
||||
testRunner.And("I fill in", ((string)(null)), table28, "And ");
|
||||
#line 293
|
||||
#line 305
|
||||
testRunner.And("I hit \"Publish\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 294
|
||||
#line 306
|
||||
testRunner.And("I go to \"my-blog/my-post-with-a-sign\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 295
|
||||
#line 307
|
||||
testRunner.Then("I should see \"<h1[^>]*>.*?My Post with a % Sign.*?</h1>\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line 296
|
||||
#line 308
|
||||
testRunner.And("I should see \"Hi there.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line hidden
|
||||
this.ScenarioCleanup();
|
||||
|
@ -163,7 +163,7 @@ Scenario: Creating and using date time fields in another culture
|
||||
And I go to "Admin/ContentTypes/"
|
||||
Then I should see "Event"
|
||||
|
||||
# Adding a Date field
|
||||
# Adding a Date field and changing its settings
|
||||
When I go to "Admin/ContentTypes/Edit/Event"
|
||||
And I follow "Add Field"
|
||||
And I fill in
|
||||
@ -174,15 +174,15 @@ Scenario: Creating and using date time fields in another culture
|
||||
And I hit "Save"
|
||||
And I am redirected
|
||||
Then I should see "The \"Date of the event\" field has been added."
|
||||
|
||||
# Date & Time are inputted based on current culture
|
||||
When I have "fr-FR" as the default culture
|
||||
And I go to "Admin/ContentTypes/Edit/Event"
|
||||
When I go to "Admin/ContentTypes/Edit/Event"
|
||||
And I fill in
|
||||
| name | value |
|
||||
| Fields[EventDate].DateTimeFieldSettings.Display | DateAndTime |
|
||||
| Fields[EventDate].DateTimeFieldSettings.Required | true |
|
||||
And I hit "Save"
|
||||
|
||||
# Date & Time are validated based on current culture
|
||||
When I have "fr-FR" as the default culture
|
||||
When I go to "Admin/Contents/Create/Event"
|
||||
And I fill in
|
||||
| name | value |
|
||||
|
12
src/Orchard.Specs/DateTime.feature.cs
generated
12
src/Orchard.Specs/DateTime.feature.cs
generated
@ -426,10 +426,8 @@ this.ScenarioSetup(scenarioInfo);
|
||||
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 176
|
||||
testRunner.Then("I should see \"The \\\"Date of the event\\\" field has been added.\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line 179
|
||||
testRunner.When("I have \"fr-FR\" as the default culture", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
||||
#line 180
|
||||
testRunner.And("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 177
|
||||
testRunner.When("I go to \"Admin/ContentTypes/Edit/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table16 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
"name",
|
||||
@ -440,10 +438,12 @@ this.ScenarioSetup(scenarioInfo);
|
||||
table16.AddRow(new string[] {
|
||||
"Fields[EventDate].DateTimeFieldSettings.Required",
|
||||
"true"});
|
||||
#line 181
|
||||
#line 178
|
||||
testRunner.And("I fill in", ((string)(null)), table16, "And ");
|
||||
#line 185
|
||||
#line 182
|
||||
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 185
|
||||
testRunner.When("I have \"fr-FR\" as the default culture", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
||||
#line 186
|
||||
testRunner.When("I go to \"Admin/Contents/Create/Event\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
||||
#line hidden
|
||||
|
@ -1,5 +1,6 @@
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Helpers;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using Autofac;
|
||||
@ -16,6 +17,7 @@ namespace Orchard.Specs.Hosting.Orchard.Web {
|
||||
}
|
||||
|
||||
protected void Application_Start() {
|
||||
AntiForgeryConfig.SuppressXFrameOptionsHeader = true;
|
||||
RegisterRoutes(RouteTable.Routes);
|
||||
_container = OrchardStarter.CreateHostContainer(MvcSingletons);
|
||||
_host = _container.Resolve<IOrchardHost>();
|
||||
@ -29,6 +31,7 @@ namespace Orchard.Specs.Hosting.Orchard.Web {
|
||||
|
||||
protected void Application_BeginRequest() {
|
||||
Context.Items["originalHttpContext"] = Context;
|
||||
HttpContext.Current.Response.AddHeader("X-Frame-Options", "SAMEORIGIN");
|
||||
_host.BeginRequest();
|
||||
}
|
||||
|
||||
@ -66,7 +69,7 @@ namespace Orchard.Specs.Hosting.Orchard.Web {
|
||||
State = TenantState.Uninitialized
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
return _host.CreateStandaloneEnvironment(settings);
|
||||
}
|
||||
}
|
||||
|
@ -154,33 +154,22 @@
|
||||
<mimeMap fileExtension=".woff2" mimeType="font/woff2" />
|
||||
</staticContent>
|
||||
</system.webServer>
|
||||
<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
|
||||
<logging level="Error" logLocation="App_data/Logs/Glimpse.log" />
|
||||
<tabs>
|
||||
<ignoredTypes>
|
||||
<add type="Glimpse.Mvc.Tab.Views, Glimpse.Mvc5" />
|
||||
<add type="Glimpse.Mvc.Tab.ModelBinding, Glimpse.Mvc5" />
|
||||
<add type="Glimpse.Mvc.Tab.Metadata, Glimpse.Mvc5" />
|
||||
<add type="Glimpse.AspNet.Tab.Cache, Glimpse.AspNet" />
|
||||
<add type="Glimpse.AspNet.Tab.Routes, Glimpse.AspNet" />
|
||||
<add type="Glimpse.AspNet.Tab.Session, Glimpse.AspNet" />
|
||||
</ignoredTypes>
|
||||
</tabs>
|
||||
<inspectors>
|
||||
<ignoredTypes>
|
||||
<add type="Glimpse.Mvc.Inspector.ViewEngineInspector, Glimpse.Mvc5" />
|
||||
<add type="Glimpse.Mvc.Inspector.DependencyInjectionInspector, Glimpse.Mvc5" />
|
||||
<add type="Glimpse.Mvc.Inspector.ModelBinderInspector, Glimpse.Mvc5" />
|
||||
<add type="Glimpse.AspNet.Inspector.RoutesInspector, Glimpse.AspNet" />
|
||||
</ignoredTypes>
|
||||
</inspectors>
|
||||
<runtimePolicies>
|
||||
<ignoredTypes>
|
||||
<!-- Uncomment the line below to allow Glimpse to be enabled for remote requests -->
|
||||
<!-- NOTE: If you uncomment this line, you can still restrict access to a set of whitelisted IP Address by adding the app setting `Orchard.Glimpse:WhitelistedIpAddresses` with a value of a semi colon separated IP Addresses to allow into the `appSettings` section of this file -->
|
||||
<!--<add type="Glimpse.AspNet.Policy.LocalPolicy, Glimpse.AspNet" />-->
|
||||
</ignoredTypes>
|
||||
</runtimePolicies>
|
||||
<!--For more information on how to configure Glimpse, please visit http://getglimpse.com/Help/Configuration or access {your site}/Glimpse.axd for even more details and a Configuration Tool to support you.-->
|
||||
</glimpse>
|
||||
<runtime>
|
||||
<gcServer enabled="true" />
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<probing privatePath="App_Data/Dependencies" />
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.5.0.0" newVersion="3.5.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.0.4000" newVersion="4.1.0.4000" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
|
@ -1,31 +1,13 @@
|
||||
Feature: Media management
|
||||
In order to reference images and such from content
|
||||
As an author
|
||||
I want to upload and manage files in a media folder
|
||||
I want to access the Media Library
|
||||
|
||||
Scenario: Media admin is available
|
||||
Given I have installed Orchard
|
||||
And I have installed "Orchard.Media"
|
||||
And I have installed "Orchard.MediaLibrary"
|
||||
|
||||
# Accessing the media page
|
||||
When I go to "admin/media"
|
||||
Then I should see "Media"
|
||||
And the status should be 200 "OK"
|
||||
|
||||
# Creating a folder
|
||||
When I go to "admin/media/create"
|
||||
And I fill in
|
||||
| name | value |
|
||||
| Name | Hello World |
|
||||
And I hit "Save"
|
||||
And I am redirected
|
||||
Then I should see "Media"
|
||||
And I should see "Hello World"
|
||||
And the status should be 200 "OK"
|
||||
|
||||
# Editing a media with limited rights
|
||||
When I go to "admin/media/edit?name=..\..\bin&mediaPath=..\..\bin"
|
||||
And I am redirected
|
||||
Then I should see "Media"
|
||||
And I should see "Editing failed: Invalid path"
|
||||
And the status should be 200 "OK"
|
||||
# Accessing the Media Library page
|
||||
When I go to "Admin/Orchard.MediaLibrary"
|
||||
Then I should see "Media Library"
|
||||
And the status should be 200 "OK"
|
||||
|
41
src/Orchard.Specs/Media.feature.cs
generated
41
src/Orchard.Specs/Media.feature.cs
generated
@ -33,7 +33,7 @@ namespace Orchard.Specs
|
||||
{
|
||||
testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
|
||||
TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Media management", " In order to reference images and such from content\r\n As an author\r\n I want to" +
|
||||
" upload and manage files in a media folder", ProgrammingLanguage.CSharp, ((string[])(null)));
|
||||
" access the Media Library", ProgrammingLanguage.CSharp, ((string[])(null)));
|
||||
testRunner.OnFeatureStart(featureInfo);
|
||||
}
|
||||
|
||||
@ -75,44 +75,13 @@ this.ScenarioSetup(scenarioInfo);
|
||||
#line 7
|
||||
testRunner.Given("I have installed Orchard", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Given ");
|
||||
#line 8
|
||||
testRunner.And("I have installed \"Orchard.Media\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
testRunner.And("I have installed \"Orchard.MediaLibrary\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 11
|
||||
testRunner.When("I go to \"admin/media\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
||||
testRunner.When("I go to \"Admin/Orchard.MediaLibrary\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
||||
#line 12
|
||||
testRunner.Then("I should see \"Media\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
testRunner.Then("I should see \"Media Library\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line 13
|
||||
testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 16
|
||||
testRunner.When("I go to \"admin/media/create\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
||||
#line hidden
|
||||
TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
|
||||
"name",
|
||||
"value"});
|
||||
table1.AddRow(new string[] {
|
||||
"Name",
|
||||
"Hello World"});
|
||||
#line 17
|
||||
testRunner.And("I fill in", ((string)(null)), table1, "And ");
|
||||
#line 20
|
||||
testRunner.And("I hit \"Save\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 21
|
||||
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 22
|
||||
testRunner.Then("I should see \"Media\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line 23
|
||||
testRunner.And("I should see \"Hello World\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 24
|
||||
testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 27
|
||||
testRunner.When("I go to \"admin/media/edit?name=..\\..\\bin&mediaPath=..\\..\\bin\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "When ");
|
||||
#line 28
|
||||
testRunner.And("I am redirected", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 29
|
||||
testRunner.Then("I should see \"Media\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "Then ");
|
||||
#line 30
|
||||
testRunner.And("I should see \"Editing failed: Invalid path\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line 31
|
||||
testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
testRunner.And("the status should be 200 \"OK\"", ((string)(null)), ((TechTalk.SpecFlow.Table)(null)), "And ");
|
||||
#line hidden
|
||||
this.ScenarioCleanup();
|
||||
}
|
||||
|
@ -547,4 +547,4 @@
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
</Project>
|
@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml;
|
||||
@ -14,6 +13,7 @@ using Orchard.Environment.Extensions.Folders;
|
||||
using Orchard.Environment.Extensions.Loaders;
|
||||
using Orchard.FileSystems.AppData;
|
||||
using Orchard.FileSystems.WebSite;
|
||||
using Orchard.Mvc;
|
||||
using Orchard.Recipes.Events;
|
||||
using Orchard.Recipes.Models;
|
||||
using Orchard.Recipes.Services;
|
||||
@ -93,6 +93,7 @@ namespace Orchard.Tests.Modules.Recipes.Services {
|
||||
builder.RegisterType<RecipeParser>().As<IRecipeParser>();
|
||||
builder.RegisterType<StubWebSiteFolder>().As<IWebSiteFolder>();
|
||||
builder.RegisterType<CustomRecipeHandler>().As<IRecipeHandler>();
|
||||
builder.RegisterType<StubHttpContextAccessor>().As<IHttpContextAccessor>();
|
||||
}
|
||||
|
||||
public override void Init() {
|
||||
|
@ -1,7 +1,13 @@
|
||||
using Autofac;
|
||||
using System.IO;
|
||||
using Autofac;
|
||||
using NHibernate;
|
||||
using NUnit.Framework;
|
||||
using Orchard.Caching;
|
||||
using Orchard.Data;
|
||||
using Orchard.Localization.Records;
|
||||
using Orchard.Localization.Services;
|
||||
using Orchard.Mvc;
|
||||
using Orchard.Tests.ContentManagement;
|
||||
using Orchard.Tests.Stubs;
|
||||
|
||||
namespace Orchard.Tests.Localization {
|
||||
@ -10,25 +16,56 @@ namespace Orchard.Tests.Localization {
|
||||
private IContainer _container;
|
||||
private IWorkContextStateProvider _currentCultureStateProvider;
|
||||
private WorkContext _workContext;
|
||||
private ISessionFactory _sessionFactory;
|
||||
private ISession _session;
|
||||
private string _databaseFileName;
|
||||
private const string _testCulture = "fr-CA";
|
||||
|
||||
[TestFixtureSetUp]
|
||||
public void InitFixture() {
|
||||
_databaseFileName = Path.GetTempFileName();
|
||||
_sessionFactory = DataUtility.CreateSessionFactory(
|
||||
_databaseFileName,
|
||||
typeof(CultureRecord));
|
||||
}
|
||||
|
||||
[SetUp]
|
||||
public void Init() {
|
||||
_session = _sessionFactory.OpenSession();
|
||||
|
||||
var builder = new ContainerBuilder();
|
||||
_workContext = new StubWorkContext();
|
||||
builder.RegisterInstance(new StubCultureSelector("fr-CA")).As<ICultureSelector>();
|
||||
builder.RegisterInstance(new StubCultureSelector(_testCulture)).As<ICultureSelector>();
|
||||
builder.RegisterInstance(new StubHttpContext("~/"));
|
||||
builder.RegisterInstance(_workContext);
|
||||
builder.RegisterType<StubHttpContextAccessor>().As<IHttpContextAccessor>();
|
||||
builder.RegisterType<CurrentCultureWorkContext>().As<IWorkContextStateProvider>();
|
||||
builder.RegisterType<DefaultCultureManager>().As<ICultureManager>();
|
||||
builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>));
|
||||
builder.RegisterType<Signals>().As<ISignals>().SingleInstance();
|
||||
builder.RegisterType<StubWorkContextAccessor>().As<IWorkContextAccessor>();
|
||||
builder.RegisterType<StubCacheManager>().As<ICacheManager>();
|
||||
_session = _sessionFactory.OpenSession();
|
||||
builder.RegisterInstance(new TestTransactionManager(_session)).As<ITransactionManager>();
|
||||
_container = builder.Build();
|
||||
_currentCultureStateProvider = _container.Resolve<IWorkContextStateProvider>();
|
||||
_container.Resolve<ICultureManager>().AddCulture(_testCulture);
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void Term() {
|
||||
_session.Close();
|
||||
}
|
||||
|
||||
[TestFixtureTearDown]
|
||||
public void TermFixture() {
|
||||
File.Delete(_databaseFileName);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CultureManagerReturnsCultureFromSelectors() {
|
||||
var actualCulture = _currentCultureStateProvider.Get<string>("CurrentCulture")(_workContext);
|
||||
var expectedCulture = "fr-CA";
|
||||
Assert.That(actualCulture, Is.EqualTo(expectedCulture));
|
||||
Assert.That(actualCulture, Is.EqualTo(_testCulture));
|
||||
}
|
||||
}
|
||||
}
|
@ -13,7 +13,7 @@ using Orchard.Localization.Services;
|
||||
namespace Orchard.Tests.Localization {
|
||||
|
||||
[TestFixture()]
|
||||
[Category("longrunning")]
|
||||
[Category("longrunning")]
|
||||
public class DefaultDateFormatterTests {
|
||||
|
||||
[SetUp]
|
||||
|
@ -142,7 +142,7 @@
|
||||
<HintPath>..\..\lib\sqlce\System.Data.SqlServerCe.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<Reference Include="System.Net.Http.Formatting, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll</HintPath>
|
||||
</Reference>
|
||||
|
@ -1,10 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using Orchard.Environment;
|
||||
using Orchard.Environment.Configuration;
|
||||
using Orchard.FileSystems.Media;
|
||||
|
||||
@ -215,8 +214,8 @@ namespace Orchard.Tests.Storage {
|
||||
|
||||
[Test]
|
||||
public void GetFileFailsInInvalidPath() {
|
||||
Assert.That(() => _storageProvider.GetFile(@"../InvalidFile.txt"), Throws.InstanceOf(typeof(ArgumentException)));
|
||||
Assert.That(() => _storageProvider.GetFile(@"../../InvalidFile.txt"), Throws.InstanceOf(typeof(ArgumentException)));
|
||||
Assert.That(() => _storageProvider.GetFile(@"../InvalidFile.txt"), Throws.InstanceOf(typeof(OrchardException)));
|
||||
Assert.That(() => _storageProvider.GetFile(@"../../InvalidFile.txt"), Throws.InstanceOf(typeof(OrchardException)));
|
||||
|
||||
// Valid get one level up within the storage provider domain
|
||||
_storageProvider.CreateFile(@"test.txt");
|
||||
@ -226,8 +225,8 @@ namespace Orchard.Tests.Storage {
|
||||
|
||||
[Test]
|
||||
public void ListFilesFailsInInvalidPath() {
|
||||
Assert.That(() => _storageProvider.ListFiles(@"../InvalidFolder"), Throws.InstanceOf(typeof(ArgumentException)));
|
||||
Assert.That(() => _storageProvider.ListFiles(@"../../InvalidFolder"), Throws.InstanceOf(typeof(ArgumentException)));
|
||||
Assert.That(() => _storageProvider.ListFiles(@"../InvalidFolder"), Throws.InstanceOf(typeof(OrchardException)));
|
||||
Assert.That(() => _storageProvider.ListFiles(@"../../InvalidFolder"), Throws.InstanceOf(typeof(OrchardException)));
|
||||
|
||||
// Valid get one level up within the storage provider domain
|
||||
Assert.That(_storageProvider.ListFiles(@"SubFolder1"), Is.Not.Null);
|
||||
@ -236,8 +235,8 @@ namespace Orchard.Tests.Storage {
|
||||
|
||||
[Test]
|
||||
public void ListFoldersFailsInInvalidPath() {
|
||||
Assert.That(() => _storageProvider.ListFolders(@"../InvalidFolder"), Throws.InstanceOf(typeof(ArgumentException)));
|
||||
Assert.That(() => _storageProvider.ListFolders(@"../../InvalidFolder"), Throws.InstanceOf(typeof(ArgumentException)));
|
||||
Assert.That(() => _storageProvider.ListFolders(@"../InvalidFolder"), Throws.InstanceOf(typeof(OrchardException)));
|
||||
Assert.That(() => _storageProvider.ListFolders(@"../../InvalidFolder"), Throws.InstanceOf(typeof(OrchardException)));
|
||||
|
||||
// Valid get one level up within the storage provider domain
|
||||
Assert.That(_storageProvider.ListFolders(@"SubFolder1"), Is.Not.Null);
|
||||
@ -255,8 +254,8 @@ namespace Orchard.Tests.Storage {
|
||||
|
||||
[Test]
|
||||
public void CreateFolderFailsInInvalidPath() {
|
||||
Assert.That(() => _storageProvider.CreateFolder(@"../InvalidFolder1"), Throws.InstanceOf(typeof(ArgumentException)));
|
||||
Assert.That(() => _storageProvider.CreateFolder(@"../../InvalidFolder1"), Throws.InstanceOf(typeof(ArgumentException)));
|
||||
Assert.That(() => _storageProvider.CreateFolder(@"../InvalidFolder1"), Throws.InstanceOf(typeof(OrchardException)));
|
||||
Assert.That(() => _storageProvider.CreateFolder(@"../../InvalidFolder1"), Throws.InstanceOf(typeof(OrchardException)));
|
||||
|
||||
// Valid create one level up within the storage provider domain
|
||||
_storageProvider.CreateFolder(@"SubFolder1\..\ValidFolder1");
|
||||
@ -265,8 +264,8 @@ namespace Orchard.Tests.Storage {
|
||||
|
||||
[Test]
|
||||
public void DeleteFolderFailsInInvalidPath() {
|
||||
Assert.That(() => _storageProvider.DeleteFolder(@"../InvalidFolder1"), Throws.InstanceOf(typeof(ArgumentException)));
|
||||
Assert.That(() => _storageProvider.DeleteFolder(@"../../InvalidFolder1"), Throws.InstanceOf(typeof(ArgumentException)));
|
||||
Assert.That(() => _storageProvider.DeleteFolder(@"../InvalidFolder1"), Throws.InstanceOf(typeof(OrchardException)));
|
||||
Assert.That(() => _storageProvider.DeleteFolder(@"../../InvalidFolder1"), Throws.InstanceOf(typeof(OrchardException)));
|
||||
|
||||
// Valid create one level up within the storage provider domain
|
||||
Assert.That(GetFolder("SubFolder1"), Is.Not.Null);
|
||||
@ -277,8 +276,8 @@ namespace Orchard.Tests.Storage {
|
||||
[Test]
|
||||
public void RenameFolderFailsInInvalidPath() {
|
||||
Assert.That(GetFolder(@"SubFolder1/SubSubFolder1"), Is.Not.Null);
|
||||
Assert.That(() => _storageProvider.RenameFolder(@"SubFolder1", @"../SubSubFolder1"), Throws.InstanceOf(typeof(ArgumentException)));
|
||||
Assert.That(() => _storageProvider.RenameFolder(@"SubFolder1", @"../../SubSubFolder1"), Throws.InstanceOf(typeof(ArgumentException)));
|
||||
Assert.That(() => _storageProvider.RenameFolder(@"SubFolder1", @"../SubSubFolder1"), Throws.InstanceOf(typeof(OrchardException)));
|
||||
Assert.That(() => _storageProvider.RenameFolder(@"SubFolder1", @"../../SubSubFolder1"), Throws.InstanceOf(typeof(OrchardException)));
|
||||
|
||||
// Valid move one level up within the storage provider domain
|
||||
_storageProvider.RenameFolder(@"SubFolder1\SubSubFolder1", @"SubFolder1\..\SubSubFolder1");
|
||||
@ -291,8 +290,8 @@ namespace Orchard.Tests.Storage {
|
||||
|
||||
[Test]
|
||||
public void DeleteFileFailsInInvalidPath() {
|
||||
Assert.That(() => _storageProvider.DeleteFile(@"../test.txt"), Throws.InstanceOf(typeof(ArgumentException)));
|
||||
Assert.That(() => _storageProvider.DeleteFile(@"../test.txt"), Throws.InstanceOf(typeof(ArgumentException)));
|
||||
Assert.That(() => _storageProvider.DeleteFile(@"../test.txt"), Throws.InstanceOf(typeof(OrchardException)));
|
||||
Assert.That(() => _storageProvider.DeleteFile(@"../test.txt"), Throws.InstanceOf(typeof(OrchardException)));
|
||||
|
||||
// Valid move one level up within the storage provider domain
|
||||
_storageProvider.CreateFile(@"test.txt");
|
||||
@ -308,8 +307,8 @@ namespace Orchard.Tests.Storage {
|
||||
|
||||
[Test]
|
||||
public void RenameFileFailsInInvalidPath() {
|
||||
Assert.That(() => _storageProvider.RenameFile(@"../test.txt", "invalid.txt"), Throws.InstanceOf(typeof(ArgumentException)));
|
||||
Assert.That(() => _storageProvider.RenameFile(@"../test.txt", "invalid.txt"), Throws.InstanceOf(typeof(ArgumentException)));
|
||||
Assert.That(() => _storageProvider.RenameFile(@"../test.txt", "invalid.txt"), Throws.InstanceOf(typeof(OrchardException)));
|
||||
Assert.That(() => _storageProvider.RenameFile(@"../test.txt", "invalid.txt"), Throws.InstanceOf(typeof(OrchardException)));
|
||||
|
||||
// Valid move one level up within the storage provider domain
|
||||
_storageProvider.CreateFile(@"test.txt");
|
||||
@ -322,8 +321,8 @@ namespace Orchard.Tests.Storage {
|
||||
|
||||
[Test]
|
||||
public void CreateFileFailsInInvalidPath() {
|
||||
Assert.That(() => _storageProvider.CreateFile(@"../InvalidFolder1.txt"), Throws.InstanceOf(typeof(ArgumentException)));
|
||||
Assert.That(() => _storageProvider.CreateFile(@"../../InvalidFolder1.txt"), Throws.InstanceOf(typeof(ArgumentException)));
|
||||
Assert.That(() => _storageProvider.CreateFile(@"../InvalidFolder1.txt"), Throws.InstanceOf(typeof(OrchardException)));
|
||||
Assert.That(() => _storageProvider.CreateFile(@"../../InvalidFolder1.txt"), Throws.InstanceOf(typeof(OrchardException)));
|
||||
|
||||
// Valid create one level up within the storage provider domain
|
||||
_storageProvider.CreateFile(@"SubFolder1\..\ValidFolder1.txt");
|
||||
@ -335,8 +334,8 @@ namespace Orchard.Tests.Storage {
|
||||
_storageProvider.CreateFile(@"test.txt");
|
||||
|
||||
using (Stream stream = GetFile("test.txt").OpenRead()) {
|
||||
Assert.That(() => _storageProvider.SaveStream(@"../newTest.txt", stream), Throws.InstanceOf(typeof(ArgumentException)));
|
||||
Assert.That(() => _storageProvider.SaveStream(@"../../newTest.txt", stream), Throws.InstanceOf(typeof(ArgumentException)));
|
||||
Assert.That(() => _storageProvider.SaveStream(@"../newTest.txt", stream), Throws.InstanceOf(typeof(OrchardException)));
|
||||
Assert.That(() => _storageProvider.SaveStream(@"../../newTest.txt", stream), Throws.InstanceOf(typeof(OrchardException)));
|
||||
|
||||
// Valid create one level up within the storage provider domain
|
||||
_storageProvider.SaveStream(@"SubFolder1\..\newTest.txt", stream);
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System.Web;
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Aspects;
|
||||
using Orchard.Core.Navigation.Models;
|
||||
@ -11,13 +12,22 @@ namespace Orchard.Core.Navigation.Services {
|
||||
|
||||
public DefaultMenuProvider(IContentManager contentManager) {
|
||||
_contentManager = contentManager;
|
||||
|
||||
_menuPartsMemory = new Dictionary<int, IEnumerable<MenuPart>>();
|
||||
}
|
||||
|
||||
// Prevent doing the same query for MenuParts more than once on a same request
|
||||
// in case we are building the same menu several times.
|
||||
private Dictionary<int, IEnumerable<MenuPart>> _menuPartsMemory;
|
||||
|
||||
public void GetMenu(IContent menu, NavigationBuilder builder) {
|
||||
var menuParts = _contentManager
|
||||
.Query<MenuPart, MenuPartRecord>()
|
||||
.Where(x => x.MenuId == menu.Id)
|
||||
.List();
|
||||
if (!_menuPartsMemory.ContainsKey(menu.Id)) {
|
||||
_menuPartsMemory[menu.Id] = _contentManager
|
||||
.Query<MenuPart, MenuPartRecord>()
|
||||
.Where(x => x.MenuId == menu.Id)
|
||||
.List();
|
||||
}
|
||||
var menuParts = _menuPartsMemory[menu.Id];
|
||||
|
||||
foreach (var menuPart in menuParts) {
|
||||
if (menuPart != null) {
|
||||
|
@ -29,6 +29,7 @@
|
||||
<compilation targetFramework="4.8">
|
||||
<assemblies>
|
||||
<add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
|
||||
<add assembly="System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
||||
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
||||
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
|
||||
|
@ -44,9 +44,8 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\lib\moq\Moq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\lib\newtonsoft.json\Newtonsoft.Json.dll</HintPath>
|
||||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework">
|
||||
<HintPath>..\..\..\..\..\lib\nunit\nunit.framework.dll</HintPath>
|
||||
|
@ -29,6 +29,7 @@
|
||||
<compilation targetFramework="4.8">
|
||||
<assemblies>
|
||||
<add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
|
||||
<add assembly="System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
||||
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
||||
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
|
||||
|
@ -69,7 +69,6 @@
|
||||
<Reference Include="System.ComponentModel.DataAnnotations">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Net.Http.Formatting, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll</HintPath>
|
||||
</Reference>
|
||||
|
@ -31,22 +31,26 @@ namespace Orchard.Localization.Handlers {
|
||||
|
||||
protected static void PropertySetHandlers(ActivatedContentContext context, LocalizationPart localizationPart) {
|
||||
localizationPart.CultureField.Setter(cultureRecord => {
|
||||
localizationPart.Record.CultureId = cultureRecord != null ? cultureRecord.Id : 0;
|
||||
localizationPart.Store<LocalizationPart, LocalizationPartRecord, int>(r => r.CultureId,
|
||||
cultureRecord != null ? cultureRecord.Id : 0);
|
||||
return cultureRecord;
|
||||
});
|
||||
|
||||
|
||||
localizationPart.MasterContentItemField.Setter(masterContentItem => {
|
||||
localizationPart.Record.MasterContentItemId = masterContentItem.ContentItem.Id;
|
||||
localizationPart.Store<LocalizationPart, LocalizationPartRecord, int>(r => r.MasterContentItemId,
|
||||
masterContentItem.ContentItem.Id);
|
||||
return masterContentItem;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
protected void LazyLoadHandlers(LocalizationPart localizationPart) {
|
||||
localizationPart.CultureField.Loader(() =>
|
||||
_cultureManager.GetCultureById(localizationPart.Record.CultureId));
|
||||
localizationPart.CultureField.Loader(() =>
|
||||
_cultureManager.GetCultureById(
|
||||
localizationPart.Retrieve<LocalizationPart, LocalizationPartRecord, int>(r => r.CultureId)));
|
||||
|
||||
localizationPart.MasterContentItemField.Loader(() =>
|
||||
_contentManager.Get(localizationPart.Record.MasterContentItemId, VersionOptions.AllVersions));
|
||||
_contentManager.Get(
|
||||
localizationPart.Retrieve<LocalizationPart, LocalizationPartRecord, int>(r => r.MasterContentItemId), VersionOptions.AllVersions));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,3 +7,4 @@ OrchardVersion: 1.10.3
|
||||
Description: Provides Orchard Recipes.
|
||||
FeatureDescription: Implementation of Orchard recipes.
|
||||
Category: Core
|
||||
Dependencies: PackagingServices
|
||||
|
@ -3,6 +3,7 @@ using System.Linq;
|
||||
using log4net;
|
||||
using Orchard.Data;
|
||||
using Orchard.Logging;
|
||||
using Orchard.Mvc;
|
||||
using Orchard.Recipes.Events;
|
||||
using Orchard.Recipes.Models;
|
||||
|
||||
@ -12,20 +13,20 @@ namespace Orchard.Recipes.Services {
|
||||
private readonly IRecipeScheduler _recipeScheduler;
|
||||
private readonly IRecipeExecuteEventHandler _recipeExecuteEventHandler;
|
||||
private readonly IRepository<RecipeStepResultRecord> _recipeStepResultRecordRepository;
|
||||
private readonly IWorkContextAccessor _workContextAccessor;
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
|
||||
public RecipeManager(
|
||||
IRecipeStepQueue recipeStepQueue,
|
||||
IRecipeScheduler recipeScheduler,
|
||||
IRecipeExecuteEventHandler recipeExecuteEventHandler,
|
||||
IRepository<RecipeStepResultRecord> recipeStepResultRecordRepository,
|
||||
IWorkContextAccessor workContextAccessor) {
|
||||
IHttpContextAccessor httpContextAccessor) {
|
||||
|
||||
_recipeStepQueue = recipeStepQueue;
|
||||
_recipeScheduler = recipeScheduler;
|
||||
_recipeExecuteEventHandler = recipeExecuteEventHandler;
|
||||
_recipeStepResultRecordRepository = recipeStepResultRecordRepository;
|
||||
_workContextAccessor = workContextAccessor;
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
|
||||
RecipeExecutionTimeout = 600;
|
||||
}
|
||||
@ -57,9 +58,9 @@ namespace Orchard.Recipes.Services {
|
||||
}
|
||||
|
||||
// Sets the request timeout to a configurable amount of seconds to give enough time to execute custom recipes.
|
||||
var workContext = _workContextAccessor.GetContext();
|
||||
if (workContext?.HttpContext != null) {
|
||||
workContext.HttpContext.Server.ScriptTimeout = RecipeExecutionTimeout;
|
||||
var httpContext = _httpContextAccessor.Current();
|
||||
if (httpContext != null) {
|
||||
httpContext.Server.ScriptTimeout = RecipeExecutionTimeout;
|
||||
}
|
||||
|
||||
var executionId = Guid.NewGuid().ToString("n");
|
||||
|
@ -29,6 +29,7 @@
|
||||
<compilation targetFramework="4.8">
|
||||
<assemblies>
|
||||
<add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
|
||||
<add assembly="System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
||||
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
||||
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
|
||||
|
@ -22,8 +22,16 @@ namespace Orchard.Taxonomies.Navigation {
|
||||
ITaxonomyService taxonomyService) {
|
||||
_contentManager = contentManager;
|
||||
_taxonomyService = taxonomyService;
|
||||
|
||||
_termsMemory = new Dictionary<string, TermPart[]>();
|
||||
}
|
||||
|
||||
// Prevent doing the same query for terms more than once on a same request
|
||||
// in case we are building menus from the same starting taxonomies. Key is a
|
||||
// string to "combine" the Id of the root TermPart and the flag telling to
|
||||
// add that root to the results.
|
||||
private Dictionary<string, TermPart[]> _termsMemory;
|
||||
|
||||
public IEnumerable<MenuItem> Filter(IEnumerable<MenuItem> items) {
|
||||
|
||||
foreach (var item in items) {
|
||||
@ -34,14 +42,21 @@ namespace Orchard.Taxonomies.Navigation {
|
||||
var rootTerm = _taxonomyService.GetTerm(taxonomyNavigationPart.TermId);
|
||||
|
||||
TermPart[] allTerms;
|
||||
|
||||
string memoryKey;
|
||||
if (rootTerm != null) {
|
||||
// if DisplayRootTerm is specified add it to the menu items to render
|
||||
allTerms = _taxonomyService.GetChildren(rootTerm, taxonomyNavigationPart.DisplayRootTerm).ToArray();
|
||||
memoryKey = $"{rootTerm.Id}_{taxonomyNavigationPart.DisplayRootTerm}";
|
||||
if (!_termsMemory.ContainsKey(memoryKey)) {
|
||||
// if DisplayRootTerm is specified add it to the menu items to render
|
||||
_termsMemory[memoryKey] = _taxonomyService.GetChildren(rootTerm, taxonomyNavigationPart.DisplayRootTerm).ToArray();
|
||||
}
|
||||
}
|
||||
else {
|
||||
allTerms = _taxonomyService.GetTerms(taxonomyNavigationPart.TaxonomyId).ToArray();
|
||||
memoryKey = taxonomyNavigationPart.TaxonomyId.ToString();
|
||||
if (!_termsMemory.ContainsKey(memoryKey)) {
|
||||
_termsMemory[memoryKey] = _taxonomyService.GetTerms(taxonomyNavigationPart.TaxonomyId).ToArray();
|
||||
}
|
||||
}
|
||||
allTerms = _termsMemory[memoryKey];
|
||||
|
||||
var rootLevel = rootTerm != null
|
||||
? rootTerm.GetLevels()
|
||||
|
@ -87,7 +87,6 @@
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Net.Http.Formatting, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll</HintPath>
|
||||
</Reference>
|
||||
|
@ -29,6 +29,7 @@
|
||||
<compilation targetFramework="4.8">
|
||||
<assemblies>
|
||||
<add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
|
||||
<add assembly="System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
||||
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
||||
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
|
||||
|
@ -70,7 +70,7 @@
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<Reference Include="System.Web.ApplicationServices" />
|
||||
<Reference Include="System.Web.DynamicData" />
|
||||
<Reference Include="System.Web.Entity" />
|
||||
|
@ -29,6 +29,7 @@
|
||||
<compilation targetFramework="4.8">
|
||||
<assemblies>
|
||||
<add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
|
||||
<add assembly="System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
||||
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
||||
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
|
||||
|
@ -84,7 +84,6 @@
|
||||
<Reference Include="System.ComponentModel.DataAnnotations">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Net.Http.Formatting, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll</HintPath>
|
||||
</Reference>
|
||||
|
@ -1,6 +1,6 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.28307.1738
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.6.33815.320
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}"
|
||||
EndProject
|
||||
@ -285,8 +285,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Conditions", "Orcha
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Resources", "Orchard.Web\Modules\Orchard.Resources\Orchard.Resources.csproj", "{D4E8F7C8-2DB2-4C50-A422-DA1DF1E3CC73}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Azure.Tests", "Orchard.Azure.Tests\Orchard.Azure.Tests.csproj", "{1CC62F45-E6FF-43D5-84BF-509A1085D994}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.OpenId", "Orchard.Web\Modules\Orchard.OpenId\Orchard.OpenId.csproj", "{42E217C1-E163-4B6B-9E8F-42BEE21B6896}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Glimpse", "Orchard.Web\Modules\Orchard.Glimpse\Orchard.Glimpse.csproj", "{71E17466-D937-49D7-8C7D-77CCBAB8CCF4}"
|
||||
@ -306,6 +304,7 @@ EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{4C95F27D-A872-481F-A9AF-851DB178C186}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
..\.github\workflows\build-crowdin-translation-packages.yml = ..\.github\workflows\build-crowdin-translation-packages.yml
|
||||
..\.github\workflows\compile.yml = ..\.github\workflows\compile.yml
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
@ -1134,16 +1133,6 @@ Global
|
||||
{D4E8F7C8-2DB2-4C50-A422-DA1DF1E3CC73}.FxCop|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D4E8F7C8-2DB2-4C50-A422-DA1DF1E3CC73}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D4E8F7C8-2DB2-4C50-A422-DA1DF1E3CC73}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{1CC62F45-E6FF-43D5-84BF-509A1085D994}.CodeCoverage|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1CC62F45-E6FF-43D5-84BF-509A1085D994}.CodeCoverage|Any CPU.Build.0 = Release|Any CPU
|
||||
{1CC62F45-E6FF-43D5-84BF-509A1085D994}.Coverage|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1CC62F45-E6FF-43D5-84BF-509A1085D994}.Coverage|Any CPU.Build.0 = Release|Any CPU
|
||||
{1CC62F45-E6FF-43D5-84BF-509A1085D994}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1CC62F45-E6FF-43D5-84BF-509A1085D994}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1CC62F45-E6FF-43D5-84BF-509A1085D994}.FxCop|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1CC62F45-E6FF-43D5-84BF-509A1085D994}.FxCop|Any CPU.Build.0 = Release|Any CPU
|
||||
{1CC62F45-E6FF-43D5-84BF-509A1085D994}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1CC62F45-E6FF-43D5-84BF-509A1085D994}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{42E217C1-E163-4B6B-9E8F-42BEE21B6896}.CodeCoverage|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{42E217C1-E163-4B6B-9E8F-42BEE21B6896}.Coverage|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{42E217C1-E163-4B6B-9E8F-42BEE21B6896}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
@ -1278,7 +1267,6 @@ Global
|
||||
{90EBEE36-B5CD-42A8-A21B-76270E2C5D24} = {DF3909B0-1DDD-4D8A-9919-56FC438E25E2}
|
||||
{98251EAE-A41B-47B2-AA91-E28B8482DA70} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
|
||||
{D4E8F7C8-2DB2-4C50-A422-DA1DF1E3CC73} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
|
||||
{1CC62F45-E6FF-43D5-84BF-509A1085D994} = {74E681ED-FECC-4034-B9BD-01B0BB1BDECA}
|
||||
{42E217C1-E163-4B6B-9E8F-42BEE21B6896} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
|
||||
{71E17466-D937-49D7-8C7D-77CCBAB8CCF4} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
|
||||
{A17BE797-D4AF-4CB4-A9FD-AE7BA09A95BD} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5}
|
||||
@ -1288,7 +1276,7 @@ Global
|
||||
{4C95F27D-A872-481F-A9AF-851DB178C186} = {06A32C3C-10A2-472E-B725-5AF102E92C6F}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EnterpriseLibraryConfigurationToolBinariesPath = packages\TransientFaultHandling.Core.5.1.1209.1\lib\NET4
|
||||
SolutionGuid = {3585D970-275B-4363-9F61-CD37CFC9DCD3}
|
||||
EnterpriseLibraryConfigurationToolBinariesPath = packages\TransientFaultHandling.Core.5.1.1209.1\lib\NET4
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
@ -25,7 +25,7 @@ namespace Orchard.Environment.Extensions {
|
||||
private readonly ICacheManager _cacheManager;
|
||||
private readonly IParallelCacheContext _parallelCacheContext;
|
||||
private readonly IEnumerable<IExtensionLoader> _loaders;
|
||||
|
||||
|
||||
public Localizer T { get; set; }
|
||||
public ILogger Logger { get; set; }
|
||||
|
||||
@ -107,14 +107,16 @@ namespace Orchard.Environment.Extensions {
|
||||
Logger.Information("Loading features");
|
||||
|
||||
// generate a cachekey by hashing the ids of all feature descriptors
|
||||
var cacheKey = BitConverter.ToString(
|
||||
_md5.ComputeHash(
|
||||
Encoding.UTF8.GetBytes(
|
||||
string.Join(";",
|
||||
featureDescriptors
|
||||
.Select(fd => fd.Id)
|
||||
.OrderBy(x => x)))));
|
||||
|
||||
string cacheKey;
|
||||
lock (_md5) {
|
||||
cacheKey = BitConverter.ToString(
|
||||
_md5.ComputeHash(
|
||||
Encoding.UTF8.GetBytes(
|
||||
string.Join(";",
|
||||
featureDescriptors
|
||||
.Select(fd => fd.Id)
|
||||
.OrderBy(x => x)))));
|
||||
}
|
||||
|
||||
var result = _cacheManager.Get(cacheKey,
|
||||
true,
|
||||
|
@ -395,6 +395,7 @@ namespace Orchard.FileSystems.Media {
|
||||
/// <param name="path">The relative path to the file to be created.</param>
|
||||
/// <param name="inputStream">The stream to be saved.</param>
|
||||
/// <exception cref="ArgumentException">If the stream can't be saved due to access permissions.</exception>
|
||||
/// <exception cref="OrchardException">If the path is invalid.</exception>
|
||||
public void SaveStream(string path, Stream inputStream) {
|
||||
// Create the file.
|
||||
// The CreateFile method will map the still relative path
|
||||
|
@ -113,9 +113,7 @@
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http">
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<Reference Include="System.Net.Http.Formatting, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll</HintPath>
|
||||
</Reference>
|
||||
|
@ -15,7 +15,7 @@ namespace Orchard.Validation {
|
||||
/// <param name="basePath">The base path which boundaries are not to be transposed.</param>
|
||||
/// <param name="mappedPath">The path to determine.</param>
|
||||
/// <rereturns>The mapped path if valid.</rereturns>
|
||||
/// <exception cref="ArgumentException">If the path is invalid.</exception>
|
||||
/// <exception cref="OrchardException">If the path is invalid.</exception>
|
||||
public static string ValidatePath(string basePath, string mappedPath) {
|
||||
bool valid = false;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user