mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-02 19:44:02 +08:00
#18530: Migrating containers order
Work Item: 18530 --HG-- branch : 1.x
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user