mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-01-07 10:14:43 +08:00
Merge branch '1.9.x' into dev
This commit is contained in:
3
.deployment
Normal file
3
.deployment
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[config]
|
||||||
|
command = deploy.cmd
|
||||||
|
SCM_COMMAND_IDLE_TIMEOUT = 3600
|
||||||
114
deploy.cmd
Normal file
114
deploy.cmd
Normal 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
@@ -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"/>
|
||||||
|
|||||||
@@ -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; }
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -207,7 +207,6 @@ namespace Orchard.Indexing.Services {
|
|||||||
_transactionManager.RequireNew();
|
_transactionManager.RequireNew();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} while (loop);
|
} while (loop);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -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" />
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ var gulp = require("gulp"),
|
|||||||
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.
|
||||||
|
|||||||
@@ -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": { }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user