Merge branch '1.7.x' of https://git01.codeplex.com/orchard into 1.7.x

This commit is contained in:
agriffard
2013-10-25 19:21:04 +02:00
3 changed files with 16 additions and 7 deletions

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Web.Mvc;
using System.Web.Routing;
@@ -380,7 +381,7 @@ namespace Orchard.Workflows.Controllers {
var model = new UpdatedActivityModel {
ClientId = clientId,
Data = formValues
Data = new NameValueCollection(formValues)
};
TempData["UpdatedViewModel"] = model;

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Web.Mvc;
using Orchard.Workflows.Models;
using Orchard.Workflows.Services;
@@ -14,7 +15,7 @@ namespace Orchard.Workflows.ViewModels {
public class UpdatedActivityModel {
public string ClientId { get; set; }
public FormCollection Data { get; set; }
public NameValueCollection Data { get; set; }
}
}

View File

@@ -209,21 +209,28 @@ namespace Upgrade.Controllers {
}
}
var processedParts = new List<string>();
foreach (var match in matches) {
// process each part only once as they could be used by multiple content types
if (processedParts.Contains(match.Part.PartDefinition.Name)) {
continue;
}
processedParts.Add(match.Part.PartDefinition.Name);
string hint, required;
match.Field.Settings.TryGetValue("MediaPickerFieldSettings.Hint", out hint);
match.Field.Settings.TryGetValue("MediaPickerFieldSettings.Required", out required);
_contentDefinitionManager.AlterPartDefinition(match.Part.PartDefinition.Name,
cfg => cfg.RemoveField(match.Field.Name));
_contentDefinitionManager.AlterPartDefinition(match.Part.PartDefinition.Name, cfg => cfg.RemoveField(match.Field.Name));
_contentDefinitionManager.AlterPartDefinition(match.Part.PartDefinition.Name, cfg => cfg
.WithField(match.Field.Name, builder => builder
.OfType("MediaLibraryPickerField")
.WithDisplayName(match.Field.DisplayName)
.WithSetting("MediaLibraryPickerFieldSettings.Hint", hint)
.WithSetting("MediaLibraryPickerFieldSettings.Required", required)
.WithSetting("MediaLibraryPickerFieldSettings.Hint", hint ?? "")
.WithSetting("MediaLibraryPickerFieldSettings.Required", required ?? "")
.WithSetting("MediaLibraryPickerFieldSettings.Multiple", false.ToString(CultureInfo.InvariantCulture))
.WithSetting("MediaLibraryPickerFieldSettings.DisplayedContentTypes", String.Empty)
));