#18530: Migrating containers order

Work Item: 18530

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2012-03-12 15:17:57 -07:00
parent 6b36a256b0
commit f9e75c648f

View File

@@ -9,6 +9,7 @@ using Orchard.Autoroute.Services;
using Orchard.ContentManagement; using Orchard.ContentManagement;
using Orchard.ContentManagement.MetaData; using Orchard.ContentManagement.MetaData;
using Orchard.Core.Common.Models; using Orchard.Core.Common.Models;
using Orchard.Core.Containers.Models;
using Orchard.Core.Title.Models; using Orchard.Core.Title.Models;
using Orchard.Data; using Orchard.Data;
using Orchard.Environment.Configuration; using Orchard.Environment.Configuration;
@@ -128,6 +129,14 @@ namespace UpgradeTo14.Controllers {
autoroutePart.DisplayAlias = path ?? String.Empty; autoroutePart.DisplayAlias = path ?? String.Empty;
titlePart.Title = title; titlePart.Title = title;
// updating order if it's a container
var containerPart = autoroutePart.As<ContainerPart>();
if(containerPart != null) {
if(!String.IsNullOrEmpty(containerPart.OrderByProperty) && containerPart.OrderByProperty.StartsWith("RoutePart")) {
containerPart.OrderByProperty = "TitlePart.Title";
}
}
_autorouteService.PublishAlias(autoroutePart); _autorouteService.PublishAlias(autoroutePart);
} }
catch(Exception e) { catch(Exception e) {