Merge branch '1.9.x' into dev

This commit is contained in:
Sipke Schoorstra
2015-07-23 11:44:57 +01:00
19 changed files with 1427 additions and 326 deletions

3
.deployment Normal file
View File

@@ -0,0 +1,3 @@
[config]
command = deploy.cmd
SCM_COMMAND_IDLE_TIMEOUT = 3600

114
deploy.cmd Normal file
View File

@@ -0,0 +1,114 @@
@if "%SCM_TRACE_LEVEL%" NEQ "4" @echo off
:: ----------------------
:: KUDU Deployment Script
:: Version: 0.1.11
:: ----------------------
:: Prerequisites
:: -------------
:: Verify node.js installed
where node 2>nul >nul
IF %ERRORLEVEL% NEQ 0 (
echo Missing node.js executable, please install node.js, if already installed make sure it can be reached from current environment.
goto error
)
:: Setup
:: -----
setlocal enabledelayedexpansion
SET ARTIFACTS=%~dp0%..\artifacts
IF NOT DEFINED DEPLOYMENT_SOURCE (
SET DEPLOYMENT_SOURCE=%~dp0%.
)
IF NOT DEFINED DEPLOYMENT_TARGET (
SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
)
IF NOT DEFINED NEXT_MANIFEST_PATH (
SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest
IF NOT DEFINED PREVIOUS_MANIFEST_PATH (
SET PREVIOUS_MANIFEST_PATH=%ARTIFACTS%\manifest
)
)
IF NOT DEFINED KUDU_SYNC_CMD (
:: Install kudu sync
echo Installing Kudu Sync
call npm install kudusync -g --silent
IF !ERRORLEVEL! NEQ 0 goto error
:: Locally just running "kuduSync" would also work
SET KUDU_SYNC_CMD=%appdata%\npm\kuduSync.cmd
)
IF NOT DEFINED DEPLOYMENT_TEMP (
SET DEPLOYMENT_TEMP=%temp%\___deployTemp%random%
SET CLEAN_LOCAL_DEPLOYMENT_TEMP=true
)
IF DEFINED CLEAN_LOCAL_DEPLOYMENT_TEMP (
IF EXIST "%DEPLOYMENT_TEMP%" rd /s /q "%DEPLOYMENT_TEMP%"
mkdir "%DEPLOYMENT_TEMP%"
)
IF NOT DEFINED MSBUILD_PATH (
SET MSBUILD_PATH=%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Deployment
:: ----------
echo Handling .NET Web Application deployment.
:: 1. Restore NuGet packages
IF /I "" NEQ "" (
call :ExecuteCmd nuget restore "%DEPLOYMENT_SOURCE%\"
IF !ERRORLEVEL! NEQ 0 goto error
)
:: 2. Build to the temporary path
call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\Orchard.proj" /t:Precompiled /v:m
IF !ERRORLEVEL! NEQ 0 goto error
:: 3. KuduSync
call :ExecuteCmd "%KUDU_SYNC_CMD%" -v 50 -f "%DEPLOYMENT_SOURCE%\build\Precompiled" -t "%DEPLOYMENT_TARGET%" -n "%NEXT_MANIFEST_PATH%" -p "%PREVIOUS_MANIFEST_PATH%" -i ".git;.hg;.deployment;deploy.cmd"
IF !ERRORLEVEL! NEQ 0 goto error
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Post deployment stub
IF DEFINED POST_DEPLOYMENT_ACTION call "%POST_DEPLOYMENT_ACTION%"
IF !ERRORLEVEL! NEQ 0 goto error
goto end
:: Execute command routine that will echo out when error
:ExecuteCmd
setlocal
set _CMD_=%*
call %_CMD_%
if "%ERRORLEVEL%" NEQ "0" echo Failed exitCode=%ERRORLEVEL%, command=%_CMD_%
exit /b %ERRORLEVEL%
:error
endlocal
echo An error has occurred during web site deployment.
call :exitSetErrorLevel
call :exitFromFunction 2>nul
:exitSetErrorLevel
exit /b 1
:exitFromFunction
()
:end
endlocal
echo Finished successfully.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -147,7 +147,7 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/> <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.0.0"/> <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/> <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/>

View File

@@ -93,13 +93,14 @@ namespace Orchard.Specs.Bindings {
_webHost = new WebHost(_orchardTemp); _webHost = new WebHost(_orchardTemp);
Host.Initialize(siteFolder, virtualDirectory ?? "/", _dynamicCompilationOption); Host.Initialize(siteFolder, virtualDirectory ?? "/", _dynamicCompilationOption);
var shuttle = new Shuttle(); var shuttle = new Shuttle();
Host.Execute(() => { Host.Execute(() => Executor(shuttle));
log4net.Config.BasicConfigurator.Configure(new CastleAppender());
HostingTraceListener.SetHook(msg => shuttle._sink.Receive(msg));
});
_messages = shuttle._sink; _messages = shuttle._sink;
} }
private static void Executor(Shuttle shuttle) {
HostingTraceListener.SetHook(msg => shuttle._sink.Receive(msg));
}
private class CastleAppender : IAppender { private class CastleAppender : IAppender {
public void Close() { } public void Close() { }
public string Name { get; set; } public string Name { get; set; }

View File

@@ -68,7 +68,7 @@ namespace Orchard.Specs.Hosting {
TargetInstance = Activator.CreateInstance(classType); TargetInstance = Activator.CreateInstance(classType);
foreach (FieldInfo field in classType.GetFields()) { foreach (FieldInfo field in classType.GetFields()) {
if (typeof (Delegate).IsAssignableFrom(field.FieldType)) if (typeof (TDelegate).IsAssignableFrom(field.FieldType))
//If the field is a delegate //If the field is a delegate
field.SetValue(TargetInstance, ((SerializableDelegate<TDelegate>)info.GetValue(field.Name, typeof(SerializableDelegate<TDelegate>))).Delegate); field.SetValue(TargetInstance, ((SerializableDelegate<TDelegate>)info.GetValue(field.Name, typeof(SerializableDelegate<TDelegate>))).Delegate);
else if (!field.FieldType.IsSerializable) else if (!field.FieldType.IsSerializable)
@@ -86,8 +86,12 @@ namespace Orchard.Specs.Hosting {
foreach (FieldInfo field in targetType.GetFields()) { foreach (FieldInfo field in targetType.GetFields()) {
//See corresponding comments above //See corresponding comments above
if (typeof (Delegate).IsAssignableFrom(field.FieldType)) if (typeof (TDelegate).IsAssignableFrom(field.FieldType)) {
info.AddValue(field.Name, new SerializableDelegate<TDelegate>((TDelegate)field.GetValue(TargetInstance))); var value = (TDelegate)field.GetValue(TargetInstance);
if (value != null) {
info.AddValue(field.Name, new SerializableDelegate<TDelegate>(value));
}
}
else if (!field.FieldType.IsSerializable) else if (!field.FieldType.IsSerializable)
info.AddValue(field.Name, new AnonymousClassWrapper(field.FieldType, field.GetValue(TargetInstance))); info.AddValue(field.Name, new AnonymousClassWrapper(field.FieldType, field.GetValue(TargetInstance)));
else else

View File

@@ -213,9 +213,9 @@ namespace Orchard.Tests.Localization {
[Description("DateTime which is DateTimeKind.Local is converted to DateTimeKind.Utc.")] [Description("DateTime which is DateTimeKind.Local is converted to DateTimeKind.Utc.")]
public void ConvertFromLocalizedDateStringTest01() { public void ConvertFromLocalizedDateStringTest01() {
var container = TestHelpers.InitializeContainer("en-US", "GregorianCalendar", TimeZoneInfo.Utc); var container = TestHelpers.InitializeContainer("en-US", "GregorianCalendar", TimeZoneInfo.Utc);
var dateTimeLocal = new DateTime(1998, 1, 15);
var dateTimeLocalString = dateTimeLocal.ToShortDateString();
var target = container.Resolve<IDateLocalizationServices>(); var target = container.Resolve<IDateLocalizationServices>();
var dateTimeLocal = new DateTime(1998, 1, 15);
var dateTimeLocalString = target.ConvertToLocalizedDateString(dateTimeLocal);
var result = target.ConvertFromLocalizedDateString(dateTimeLocalString); var result = target.ConvertFromLocalizedDateString(dateTimeLocalString);
Assert.AreEqual(DateTimeKind.Utc, result.Value.Kind); Assert.AreEqual(DateTimeKind.Utc, result.Value.Kind);
} }

View File

@@ -70,6 +70,10 @@ namespace Orchard.Autoroute.Handlers {
if (current != null) { if (current != null) {
current.CustomPattern = String.Empty; // force the regeneration current.CustomPattern = String.Empty; // force the regeneration
current.DisplayAlias = _autorouteService.Value.GenerateAlias(current); current.DisplayAlias = _autorouteService.Value.GenerateAlias(current);
// we changed the alias of the previous homepage, so publish this change if the content item was published.
if(current.IsPublished())
_orchardServices.ContentManager.Publish(current.ContentItem);
} }
_autorouteService.Value.PublishAlias(current); _autorouteService.Value.PublishAlias(current);
} }

View File

@@ -27,7 +27,7 @@
<li class="sgd-s"><div class="name">@T("Shape").Text</div><div class="value">${shape.type}</div></li> <li class="sgd-s"><div class="name">@T("Shape").Text</div><div class="value">${shape.type}</div></li>
<li class="sgd-t"><div class="name">@T("Active Template").Text</div><div class="value"><a id="activeTemplate" href="#">${shape.template}</a></div></li> <li class="sgd-t"><div class="name">@T("Active Template").Text</div><div class="value"><a id="activeTemplate" href="#">${shape.template}</a></div></li>
{{if shape.template != shape.originalTemplate}} {{if shape.template != shape.originalTemplate}}
<li class="sgd-ot"><div class="name">@T("Original Template").Text Template</div><div class="value">${shape.originalTemplate}</div></li> <li class="sgd-ot"><div class="name">@T("Original Template").Text</div><div class="value">${shape.originalTemplate}</div></li>
{{/if}} {{/if}}
<li class="sgd-d"><div class="name">@T("Display Type").Text</div><div class="value">${shape.displayType}</div></li> <li class="sgd-d"><div class="name">@T("Display Type").Text</div><div class="value">${shape.displayType}</div></li>
<li class="sgd-a"><div class="name">@T("Alternate ({0})", "${shape.alternates.length}").Text</div> <li class="sgd-a"><div class="name">@T("Alternate ({0})", "${shape.alternates.length}").Text</div>

File diff suppressed because one or more lines are too long

View File

@@ -45,8 +45,10 @@ namespace Orchard.DynamicForms.ValidationRules {
if(Minimum != null && Maximum != null) if(Minimum != null && Maximum != null)
return T("{0} must be between {1} and {2} characters long.", context.FieldName, Minimum, Maximum); return T("{0} must be between {1} and {2} characters long.", context.FieldName, Minimum, Maximum);
else if (Minimum != null)
return T("{0} must be at least {1} characters long.", context.FieldName, Minimum);
return T("{0} must be at least {1} characters long.", context.FieldName, Minimum); return T("{0} must be at most {1} characters long.", context.FieldName, Maximum);
} }
} }
} }

View File

@@ -14,12 +14,12 @@
var gulp = require("gulp"), var gulp = require("gulp"),
newer = require("gulp-newer"), newer = require("gulp-newer"),
minify = require("gulp-minify-css"), minify = require("gulp-minify-css"),
uglify = require("gulp-uglify"), uglify = require("gulp-uglify"),
rename = require("gulp-rename"), rename = require("gulp-rename"),
concat = require("gulp-concat"), concat = require("gulp-concat"),
sourcemaps = require("gulp-sourcemaps"), sourcemaps = require("gulp-sourcemaps"),
merge = require("merge-stream"); merge = require("merge-stream");
/* /*
* General tasks. * General tasks.
@@ -43,11 +43,11 @@ var srcCss = [
gulp.task("buildCss", function () { gulp.task("buildCss", function () {
return gulp.src(srcCss) return gulp.src(srcCss)
.pipe(minify()) .pipe(minify())
.pipe(rename({ .pipe(rename({
suffix: ".min" suffix: ".min"
})) }))
.pipe(gulp.dest("Styles")); .pipe(gulp.dest("Styles"));
}); });
gulp.task("watchCss", function () { gulp.task("watchCss", function () {
@@ -62,9 +62,9 @@ gulp.task("watchCss", function () {
*/ */
var srcJsLib = [ var srcJsLib = [
"Scripts/Lib/jquery.validate.js", "Scripts/Lib/jquery.validate.js",
"Scripts/Lib/jquery.validate.unobtrusive.additional.js", "Scripts/Lib/jquery.validate.unobtrusive.additional.js",
"Scripts/Lib/jquery.validate.unobtrusive.js" "Scripts/Lib/jquery.validate.unobtrusive.js"
]; ];
var srcJsLayoutEditor = [ var srcJsLayoutEditor = [
@@ -90,12 +90,12 @@ function jsPipelineFrom(inputStream, outputFolder, outputFile) {
return inputStream return inputStream
.pipe(newer(outputFolder + "/" + outputFile)) .pipe(newer(outputFolder + "/" + outputFile))
.pipe(sourcemaps.init()) .pipe(sourcemaps.init())
.pipe(concat(outputFile)) .pipe(concat(outputFile))
.pipe(sourcemaps.write()) .pipe(sourcemaps.write())
.pipe(gulp.dest(outputFolder)) .pipe(gulp.dest(outputFolder))
.pipe(uglify()) .pipe(uglify())
.pipe(rename({ .pipe(rename({
suffix: ".min" suffix: ".min"
})) }))
.pipe(gulp.dest(outputFolder)); .pipe(gulp.dest(outputFolder));
} }

View File

@@ -174,18 +174,18 @@ namespace Orchard.Indexing.Services {
var settings = GetTypeIndexingSettings(item); var settings = GetTypeIndexingSettings(item);
// skip items from types which are not indexed // skip items from types which are not indexed
if (settings.List.Contains(indexName)) { if (settings.List.Contains(indexName)) {
if (item.HasPublished()) { if (item.HasPublished()) {
var published = _contentManager.Get(item.Id, VersionOptions.Published); var published = _contentManager.Get(item.Id, VersionOptions.Published);
IDocumentIndex documentIndex = ExtractDocumentIndex(published); IDocumentIndex documentIndex = ExtractDocumentIndex(published);
if (documentIndex != null && documentIndex.IsDirty) { if (documentIndex != null && documentIndex.IsDirty) {
addToIndex.Add(documentIndex); addToIndex.Add(documentIndex);
}
} }
} }
} else if (settings.List.Contains(indexName + ":latest")) {
else if (settings.List.Contains(indexName + ":latest")) {
IDocumentIndex documentIndex = ExtractDocumentIndex(item); IDocumentIndex documentIndex = ExtractDocumentIndex(item);
if (documentIndex != null && documentIndex.IsDirty) { if (documentIndex != null && documentIndex.IsDirty) {
@@ -205,8 +205,7 @@ namespace Orchard.Indexing.Services {
} }
else { else {
_transactionManager.RequireNew(); _transactionManager.RequireNew();
} }
} while (loop); } while (loop);
} }
@@ -238,10 +237,10 @@ namespace Orchard.Indexing.Services {
if (settings.List.Contains(indexName)) { if (settings.List.Contains(indexName)) {
documentIndex = ExtractDocumentIndex(item.ContentItem); documentIndex = ExtractDocumentIndex(item.ContentItem);
} }
else if (settings.List.Contains(indexName + ":latest")) { else if (settings.List.Contains(indexName + ":latest")) {
var latest = _contentManager.Get(item.Id, VersionOptions.Latest); var latest = _contentManager.Get(item.Id, VersionOptions.Latest);
documentIndex = ExtractDocumentIndex(latest); documentIndex = ExtractDocumentIndex(latest);
} }
} }
if (documentIndex == null || item.Delete) { if (documentIndex == null || item.Delete) {
@@ -264,8 +263,8 @@ namespace Orchard.Indexing.Services {
else { else {
_transactionManager.RequireNew(); _transactionManager.RequireNew();
} }
}
while (loop); } while (loop);
} }
// save current state of the index // save current state of the index

View File

@@ -1,5 +1,4 @@
/// <autosync enabled="false" /> /// <autosync enabled="false" />
/// <reference path="Lib/affix.js" />
/// <reference path="Lib/angular-resource.js" /> /// <reference path="Lib/angular-resource.js" />
/// <reference path="Lib/angular-sanitize.js" /> /// <reference path="Lib/angular-sanitize.js" />
/// <reference path="Lib/angular.js" /> /// <reference path="Lib/angular.js" />

View File

@@ -14,15 +14,15 @@
var gulp = require("gulp"), var gulp = require("gulp"),
newer = require("gulp-newer"), newer = require("gulp-newer"),
plumber = require("gulp-plumber"), plumber = require("gulp-plumber"),
sourcemaps = require("gulp-sourcemaps"), sourcemaps = require("gulp-sourcemaps"),
less = require("gulp-less"), less = require("gulp-less"),
autoprefixer = require("gulp-autoprefixer"), autoprefixer = require("gulp-autoprefixer"),
minify = require("gulp-minify-css"), minify = require("gulp-minify-css"),
uglify = require("gulp-uglify"), uglify = require("gulp-uglify"),
rename = require("gulp-rename"), rename = require("gulp-rename"),
concat = require("gulp-concat"), concat = require("gulp-concat"),
merge = require("merge-stream") merge = require("merge-stream");
/* /*
* General tasks. * General tasks.
@@ -72,18 +72,18 @@ gulp.task("watchLess", function () {
function lessPipelineFrom(inputStream, outputFolder, outputFile) { function lessPipelineFrom(inputStream, outputFolder, outputFile) {
return inputStream return inputStream
.pipe(newer(outputFolder + "/" + outputFile)) .pipe(newer(outputFolder + "/" + outputFile))
.pipe(plumber()) .pipe(plumber())
.pipe(sourcemaps.init()) .pipe(sourcemaps.init())
.pipe(less()) .pipe(less())
.pipe(concat(outputFile)) .pipe(concat(outputFile))
.pipe(autoprefixer({ browsers: ["last 2 versions"] })) .pipe(autoprefixer({ browsers: ["last 2 versions"] }))
.pipe(sourcemaps.write()) .pipe(sourcemaps.write())
.pipe(gulp.dest(outputFolder)) .pipe(gulp.dest(outputFolder))
.pipe(minify()) .pipe(minify())
.pipe(rename({ .pipe(rename({
suffix: ".min" suffix: ".min"
})) }))
.pipe(gulp.dest(outputFolder)); .pipe(gulp.dest(outputFolder));
} }
/* /*
@@ -91,11 +91,11 @@ function lessPipelineFrom(inputStream, outputFolder, outputFile) {
*/ */
var srcJsLib = [ var srcJsLib = [
"Scripts/Lib/underscore.js", "Scripts/Lib/underscore.js",
"Scripts/Lib/angular.js", "Scripts/Lib/angular.js",
"Scripts/Lib/angular-sanitize.js", "Scripts/Lib/angular-sanitize.js",
"Scripts/Lib/angular-resource.js", "Scripts/Lib/angular-resource.js",
"Scripts/Lib/sortable.js" "Scripts/Lib/sortable.js"
]; ];
var srcJsLayoutEditor = [ var srcJsLayoutEditor = [
@@ -146,14 +146,14 @@ gulp.task("watchJs", function () {
function jsPipelineFrom(inputStream, outputFolder, outputFile) { function jsPipelineFrom(inputStream, outputFolder, outputFile) {
return inputStream return inputStream
.pipe(newer(outputFolder + "/" + outputFile)) .pipe(newer(outputFolder + "/" + outputFile))
.pipe(plumber()) .pipe(plumber())
.pipe(sourcemaps.init()) .pipe(sourcemaps.init())
.pipe(concat(outputFile)) .pipe(concat(outputFile))
.pipe(sourcemaps.write()) .pipe(sourcemaps.write())
.pipe(gulp.dest(outputFolder)) .pipe(gulp.dest(outputFolder))
.pipe(uglify()) .pipe(uglify())
.pipe(rename({ .pipe(rename({
suffix: ".min" suffix: ".min"
})) }))
.pipe(gulp.dest(outputFolder)); .pipe(gulp.dest(outputFolder));
} }

View File

@@ -10,7 +10,8 @@
"gulp-uglify": "^1.2.0", "gulp-uglify": "^1.2.0",
"gulp-rename": "^1.2.2", "gulp-rename": "^1.2.2",
"gulp-concat": "^2.5.2", "gulp-concat": "^2.5.2",
"merge-stream": "^0.1.7" "merge-stream": "^0.1.7",
"del": "^1.1.1"
}, },
"dependencies": { } "dependencies": { }
} }

View File

@@ -59,8 +59,9 @@ namespace Orchard.Localization.Drivers {
protected override DriverResult Editor(LocalizationPart part, IUpdateModel updater, dynamic shapeHelper) { protected override DriverResult Editor(LocalizationPart part, IUpdateModel updater, dynamic shapeHelper) {
var model = new EditLocalizationViewModel(); var model = new EditLocalizationViewModel();
// Content culture has to be set only if it's not set already. // GetCulture(part) is checked against null value, because the content culture has to be set only if it's not set already.
if (updater != null && updater.TryUpdateModel(model, TemplatePrefix, null, null) && GetCulture(part) == null) { // model.SelectedCulture is checked against null value, because the editor group may not contain LocalizationPart when the content item is saved for the first time.
if (updater != null && updater.TryUpdateModel(model, TemplatePrefix, null, null) && GetCulture(part) == null && !string.IsNullOrEmpty(model.SelectedCulture)) {
_localizationService.SetContentCulture(part, model.SelectedCulture); _localizationService.SetContentCulture(part, model.SelectedCulture);
} }