#20577: Fixing Orchard.Templates

Work Item: 20577
This commit is contained in:
Sebastien Ros
2014-03-26 12:21:36 -07:00
parent 365060b7c6
commit 35d2a6c8fd
33 changed files with 127 additions and 393 deletions

View File

@@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
using Orchard.Compilation.Razor;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Drivers;
using Orchard.ContentManagement.Handlers;
@@ -16,15 +15,12 @@ using Orchard.Utility.Extensions;
namespace Orchard.Templates.Drivers {
public class ShapePartDriver : ContentPartDriver<ShapePart> {
private readonly IEnumerable<ITemplateProcessor> _processors;
private readonly IRazorTemplateHolder _templateHolder;
private readonly ITransactionManager _transactions;
public ShapePartDriver(
IEnumerable<ITemplateProcessor> processors,
IRazorTemplateHolder templateHolder,
ITransactionManager transactions) {
_processors = processors;
_templateHolder = templateHolder;
_transactions = transactions;
T = NullLocalizer.Instance;
}
@@ -48,7 +44,6 @@ namespace Orchard.Templates.Drivers {
try {
var processor = _processors.FirstOrDefault(x => String.Equals(x.Type, part.ProcessorName, StringComparison.OrdinalIgnoreCase)) ?? _processors.First();
processor.Verify(part.Template);
_templateHolder.Set(part.Name, part.Template);
}
catch (Exception ex) {
updater.AddModelError("", T("Template processing error: {0}", ex.Message));