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
@@ -147,7 +147,7 @@
</dependentAssembly>
<dependentAssembly>
<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>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/>
+5 -4
View File
@@ -93,13 +93,14 @@ namespace Orchard.Specs.Bindings {
_webHost = new WebHost(_orchardTemp);
Host.Initialize(siteFolder, virtualDirectory ?? "/", _dynamicCompilationOption);
var shuttle = new Shuttle();
Host.Execute(() => {
log4net.Config.BasicConfigurator.Configure(new CastleAppender());
HostingTraceListener.SetHook(msg => shuttle._sink.Receive(msg));
});
Host.Execute(() => Executor(shuttle));
_messages = shuttle._sink;
}
private static void Executor(Shuttle shuttle) {
HostingTraceListener.SetHook(msg => shuttle._sink.Receive(msg));
}
private class CastleAppender : IAppender {
public void Close() { }
public string Name { get; set; }
@@ -68,7 +68,7 @@ namespace Orchard.Specs.Hosting {
TargetInstance = Activator.CreateInstance(classType);
foreach (FieldInfo field in classType.GetFields()) {
if (typeof (Delegate).IsAssignableFrom(field.FieldType))
if (typeof (TDelegate).IsAssignableFrom(field.FieldType))
//If the field is a delegate
field.SetValue(TargetInstance, ((SerializableDelegate<TDelegate>)info.GetValue(field.Name, typeof(SerializableDelegate<TDelegate>))).Delegate);
else if (!field.FieldType.IsSerializable)
@@ -86,8 +86,12 @@ namespace Orchard.Specs.Hosting {
foreach (FieldInfo field in targetType.GetFields()) {
//See corresponding comments above
if (typeof (Delegate).IsAssignableFrom(field.FieldType))
info.AddValue(field.Name, new SerializableDelegate<TDelegate>((TDelegate)field.GetValue(TargetInstance)));
if (typeof (TDelegate).IsAssignableFrom(field.FieldType)) {
var value = (TDelegate)field.GetValue(TargetInstance);
if (value != null) {
info.AddValue(field.Name, new SerializableDelegate<TDelegate>(value));
}
}
else if (!field.FieldType.IsSerializable)
info.AddValue(field.Name, new AnonymousClassWrapper(field.FieldType, field.GetValue(TargetInstance)));
else
@@ -213,9 +213,9 @@ namespace Orchard.Tests.Localization {
[Description("DateTime which is DateTimeKind.Local is converted to DateTimeKind.Utc.")]
public void ConvertFromLocalizedDateStringTest01() {
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 dateTimeLocal = new DateTime(1998, 1, 15);
var dateTimeLocalString = target.ConvertToLocalizedDateString(dateTimeLocal);
var result = target.ConvertFromLocalizedDateString(dateTimeLocalString);
Assert.AreEqual(DateTimeKind.Utc, result.Value.Kind);
}
@@ -70,6 +70,10 @@ namespace Orchard.Autoroute.Handlers {
if (current != null) {
current.CustomPattern = String.Empty; // force the regeneration
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);
}
@@ -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-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}}
<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}}
<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>
File diff suppressed because one or more lines are too long
@@ -45,8 +45,10 @@ namespace Orchard.DynamicForms.ValidationRules {
if(Minimum != null && Maximum != null)
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);
}
}
}
}
@@ -14,12 +14,12 @@
var gulp = require("gulp"),
newer = require("gulp-newer"),
minify = require("gulp-minify-css"),
uglify = require("gulp-uglify"),
rename = require("gulp-rename"),
concat = require("gulp-concat"),
minify = require("gulp-minify-css"),
uglify = require("gulp-uglify"),
rename = require("gulp-rename"),
concat = require("gulp-concat"),
sourcemaps = require("gulp-sourcemaps"),
merge = require("merge-stream");
merge = require("merge-stream");
/*
* General tasks.
@@ -43,11 +43,11 @@ var srcCss = [
gulp.task("buildCss", function () {
return gulp.src(srcCss)
.pipe(minify())
.pipe(rename({
suffix: ".min"
}))
.pipe(gulp.dest("Styles"));
.pipe(minify())
.pipe(rename({
suffix: ".min"
}))
.pipe(gulp.dest("Styles"));
});
gulp.task("watchCss", function () {
@@ -62,9 +62,9 @@ gulp.task("watchCss", function () {
*/
var srcJsLib = [
"Scripts/Lib/jquery.validate.js",
"Scripts/Lib/jquery.validate.unobtrusive.additional.js",
"Scripts/Lib/jquery.validate.unobtrusive.js"
"Scripts/Lib/jquery.validate.js",
"Scripts/Lib/jquery.validate.unobtrusive.additional.js",
"Scripts/Lib/jquery.validate.unobtrusive.js"
];
var srcJsLayoutEditor = [
@@ -90,12 +90,12 @@ function jsPipelineFrom(inputStream, outputFolder, outputFile) {
return inputStream
.pipe(newer(outputFolder + "/" + outputFile))
.pipe(sourcemaps.init())
.pipe(concat(outputFile))
.pipe(concat(outputFile))
.pipe(sourcemaps.write())
.pipe(gulp.dest(outputFolder))
.pipe(uglify())
.pipe(rename({
suffix: ".min"
}))
.pipe(gulp.dest(outputFolder));
.pipe(gulp.dest(outputFolder))
.pipe(uglify())
.pipe(rename({
suffix: ".min"
}))
.pipe(gulp.dest(outputFolder));
}
@@ -174,18 +174,18 @@ namespace Orchard.Indexing.Services {
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 (item.HasPublished()) {
var published = _contentManager.Get(item.Id, VersionOptions.Published);
IDocumentIndex documentIndex = ExtractDocumentIndex(published);
if (item.HasPublished()) {
var published = _contentManager.Get(item.Id, VersionOptions.Published);
IDocumentIndex documentIndex = ExtractDocumentIndex(published);
if (documentIndex != null && documentIndex.IsDirty) {
addToIndex.Add(documentIndex);
if (documentIndex != null && documentIndex.IsDirty) {
addToIndex.Add(documentIndex);
}
}
}
}
else if (settings.List.Contains(indexName + ":latest")) {
else if (settings.List.Contains(indexName + ":latest")) {
IDocumentIndex documentIndex = ExtractDocumentIndex(item);
if (documentIndex != null && documentIndex.IsDirty) {
@@ -205,8 +205,7 @@ namespace Orchard.Indexing.Services {
}
else {
_transactionManager.RequireNew();
}
}
} while (loop);
}
@@ -238,10 +237,10 @@ namespace Orchard.Indexing.Services {
if (settings.List.Contains(indexName)) {
documentIndex = ExtractDocumentIndex(item.ContentItem);
}
else if (settings.List.Contains(indexName + ":latest")) {
var latest = _contentManager.Get(item.Id, VersionOptions.Latest);
documentIndex = ExtractDocumentIndex(latest);
}
else if (settings.List.Contains(indexName + ":latest")) {
var latest = _contentManager.Get(item.Id, VersionOptions.Latest);
documentIndex = ExtractDocumentIndex(latest);
}
}
if (documentIndex == null || item.Delete) {
@@ -264,8 +263,8 @@ namespace Orchard.Indexing.Services {
else {
_transactionManager.RequireNew();
}
}
while (loop);
} while (loop);
}
// save current state of the index
@@ -1,5 +1,4 @@
/// <autosync enabled="false" />
/// <reference path="Lib/affix.js" />
/// <reference path="Lib/angular-resource.js" />
/// <reference path="Lib/angular-sanitize.js" />
/// <reference path="Lib/angular.js" />
@@ -14,15 +14,15 @@
var gulp = require("gulp"),
newer = require("gulp-newer"),
plumber = require("gulp-plumber"),
plumber = require("gulp-plumber"),
sourcemaps = require("gulp-sourcemaps"),
less = require("gulp-less"),
autoprefixer = require("gulp-autoprefixer"),
minify = require("gulp-minify-css"),
uglify = require("gulp-uglify"),
rename = require("gulp-rename"),
concat = require("gulp-concat"),
merge = require("merge-stream")
autoprefixer = require("gulp-autoprefixer"),
minify = require("gulp-minify-css"),
uglify = require("gulp-uglify"),
rename = require("gulp-rename"),
concat = require("gulp-concat"),
merge = require("merge-stream");
/*
* General tasks.
@@ -72,18 +72,18 @@ gulp.task("watchLess", function () {
function lessPipelineFrom(inputStream, outputFolder, outputFile) {
return inputStream
.pipe(newer(outputFolder + "/" + outputFile))
.pipe(plumber())
.pipe(plumber())
.pipe(sourcemaps.init())
.pipe(less())
.pipe(concat(outputFile))
.pipe(autoprefixer({ browsers: ["last 2 versions"] }))
.pipe(less())
.pipe(concat(outputFile))
.pipe(autoprefixer({ browsers: ["last 2 versions"] }))
.pipe(sourcemaps.write())
.pipe(gulp.dest(outputFolder))
.pipe(minify())
.pipe(rename({
suffix: ".min"
}))
.pipe(gulp.dest(outputFolder));
.pipe(gulp.dest(outputFolder))
.pipe(minify())
.pipe(rename({
suffix: ".min"
}))
.pipe(gulp.dest(outputFolder));
}
/*
@@ -91,11 +91,11 @@ function lessPipelineFrom(inputStream, outputFolder, outputFile) {
*/
var srcJsLib = [
"Scripts/Lib/underscore.js",
"Scripts/Lib/angular.js",
"Scripts/Lib/angular-sanitize.js",
"Scripts/Lib/angular-resource.js",
"Scripts/Lib/sortable.js"
"Scripts/Lib/underscore.js",
"Scripts/Lib/angular.js",
"Scripts/Lib/angular-sanitize.js",
"Scripts/Lib/angular-resource.js",
"Scripts/Lib/sortable.js"
];
var srcJsLayoutEditor = [
@@ -146,14 +146,14 @@ gulp.task("watchJs", function () {
function jsPipelineFrom(inputStream, outputFolder, outputFile) {
return inputStream
.pipe(newer(outputFolder + "/" + outputFile))
.pipe(plumber())
.pipe(plumber())
.pipe(sourcemaps.init())
.pipe(concat(outputFile))
.pipe(concat(outputFile))
.pipe(sourcemaps.write())
.pipe(gulp.dest(outputFolder))
.pipe(uglify())
.pipe(rename({
suffix: ".min"
}))
.pipe(gulp.dest(outputFolder));
.pipe(gulp.dest(outputFolder))
.pipe(uglify())
.pipe(rename({
suffix: ".min"
}))
.pipe(gulp.dest(outputFolder));
}
@@ -10,7 +10,8 @@
"gulp-uglify": "^1.2.0",
"gulp-rename": "^1.2.2",
"gulp-concat": "^2.5.2",
"merge-stream": "^0.1.7"
"merge-stream": "^0.1.7",
"del": "^1.1.1"
},
"dependencies": { }
}
@@ -59,8 +59,9 @@ namespace Orchard.Localization.Drivers {
protected override DriverResult Editor(LocalizationPart part, IUpdateModel updater, dynamic shapeHelper) {
var model = new EditLocalizationViewModel();
// 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) {
// GetCulture(part) is checked against null value, because the content culture has to be set only if it's not set already.
// 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);
}