@Html.TextBoxFor(m => m.Description, new { @class = "tokenized text medium" })
- @T("The description field of the RSS item")
+ @T("The description field of the RSS item. The content needs to be raw HTML, i.e. not encoded.")
diff --git a/src/Orchard.Web/Modules/Orchard.Users/Controllers/AccountController.cs b/src/Orchard.Web/Modules/Orchard.Users/Controllers/AccountController.cs
index 35699d7da..6360a2574 100644
--- a/src/Orchard.Web/Modules/Orchard.Users/Controllers/AccountController.cs
+++ b/src/Orchard.Web/Modules/Orchard.Users/Controllers/AccountController.cs
@@ -64,9 +64,9 @@ namespace Orchard.Users.Controllers {
}
[AlwaysAccessible]
- public ActionResult LogOn() {
+ public ActionResult LogOn(string returnUrl) {
if (_authenticationService.GetAuthenticatedUser() != null)
- return Redirect("~/");
+ return this.RedirectLocal(returnUrl);
var shape = _orchardServices.New.LogOn().Title(T("Log On").Text);
return new ShapeResult(this, shape);
diff --git a/src/Orchard/Data/Migration/DataMigrationManager.cs b/src/Orchard/Data/Migration/DataMigrationManager.cs
index 2ce65beab..1ef6e33d7 100644
--- a/src/Orchard/Data/Migration/DataMigrationManager.cs
+++ b/src/Orchard/Data/Migration/DataMigrationManager.cs
@@ -22,7 +22,7 @@ namespace Orchard.Data.Migration {
private readonly IContentDefinitionManager _contentDefinitionManager;
private readonly ITransactionManager _transactionManager;
- private List _processedFeatures;
+ private readonly List _processedFeatures;
public DataMigrationManager(
IEnumerable dataMigrations,
@@ -40,6 +40,7 @@ namespace Orchard.Data.Migration {
_processedFeatures = new List();
Logger = NullLogger.Instance;
+ T = NullLocalizer.Instance;
}
public Localizer T { get; set; }
public ILogger Logger { get; set; }
@@ -118,11 +119,11 @@ namespace Orchard.Data.Migration {
while (lookupTable.ContainsKey(current)) {
try {
- Logger.Information("Applying migration for {0} from version {1}", feature, current);
+ Logger.Information("Applying migration for {0} from version {1}.", feature, current);
current = (int)lookupTable[current].Invoke(migration, new object[0]);
}
catch (Exception ex) {
- Logger.Error(ex, "An unexpected error occurred while applying migration on {0} from version {1}", feature, current);
+ Logger.Error(ex, "An unexpected error occurred while applying migration on {0} from version {1}.", feature, current);
throw;
}
}
@@ -139,15 +140,16 @@ namespace Orchard.Data.Migration {
}
}
catch (Exception e) {
- Logger.Error(e, "Error while running migration version {0} for {1}", current, feature);
+ Logger.Error(e, "Error while running migration version {0} for {1}.", current, feature);
_transactionManager.Cancel();
+ throw new OrchardException(T("Error while running migration version {0} for {1}.", current, feature), e);
}
}
}
public void Uninstall(string feature) {
- Logger.Information("Uninstalling feature: {0}", feature);
+ Logger.Information("Uninstalling feature: {0}.", feature);
var migrations = GetDataMigrations(feature);
diff --git a/src/Orchard/Data/Repository.cs b/src/Orchard/Data/Repository.cs
index 4f42f512a..92bb29101 100644
--- a/src/Orchard/Data/Repository.cs
+++ b/src/Orchard/Data/Repository.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
@@ -111,6 +112,30 @@ namespace Orchard.Data {
Logger.Debug("Copy {0} {1}", source, target);
var metadata = Session.SessionFactory.GetClassMetadata(typeof (T));
var values = metadata.GetPropertyValues(source, EntityMode.Poco);
+
+ //This method is currently only used by StorageVersionFilter<>.Versioning()
+ //In order to prevent shared references to the same collection instance
+ //Instances of IList<> need to be copied to a new collection instance
+ for (var index = 0; index < values.Length; index++) {
+ var value = values[index];
+ if (value == null)
+ continue;
+
+ var type = value.GetType();
+ var isGenericList = type.GetInterfaces()
+ .Where(i => i.IsGenericType)
+ .Any(i => i.GetGenericTypeDefinition() == typeof(IList<>));
+
+ if(!isGenericList)
+ continue;
+
+ var genericArgument = type.GetGenericArguments().First();
+ var genericType = typeof(List<>).MakeGenericType(new[] { genericArgument });
+
+ var listValues = ((IList)value);
+ values[index] = Activator.CreateInstance(genericType, new[] { listValues });
+ }
+
metadata.SetPropertyValues(target, values, EntityMode.Poco);
}
diff --git a/src/Orchard/DisplayManagement/Descriptors/ShapePlacementStrategy/PlacementFileParser.cs b/src/Orchard/DisplayManagement/Descriptors/ShapePlacementStrategy/PlacementFileParser.cs
index 4b736d874..8725ded54 100644
--- a/src/Orchard/DisplayManagement/Descriptors/ShapePlacementStrategy/PlacementFileParser.cs
+++ b/src/Orchard/DisplayManagement/Descriptors/ShapePlacementStrategy/PlacementFileParser.cs
@@ -12,6 +12,7 @@ namespace Orchard.DisplayManagement.Descriptors.ShapePlacementStrategy {
///
public interface IPlacementFileParser : IDependency {
PlacementFile Parse(string virtualPath);
+ PlacementFile ParseText(string placementText);
}
@@ -37,11 +38,11 @@ namespace Orchard.DisplayManagement.Descriptors.ShapePlacementStrategy {
}
var placementText = _webSiteFolder.ReadFile(virtualPath);
- return ParseImplementation(virtualPath, placementText);
+ return ParseText(placementText);
});
}
- private PlacementFile ParseImplementation(string virtualPath, string placementText) {
+ public PlacementFile ParseText(string placementText) {
if (placementText == null)
return null;