mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Improving error messages in migration module
--HG-- branch : autoroute
This commit is contained in:
@@ -71,11 +71,20 @@ namespace UpgradeTo14.Controllers {
|
|||||||
var session = sessionFactory.OpenSession();
|
var session = sessionFactory.OpenSession();
|
||||||
|
|
||||||
foreach (var contentType in contentTypesToMigrate) {
|
foreach (var contentType in contentTypesToMigrate) {
|
||||||
// migrating pages
|
|
||||||
|
if (_orchardServices.ContentManager.HqlQuery().ForType(contentType).Count() > 0 &&
|
||||||
|
_orchardServices.ContentManager.HqlQuery().ForType(contentType).Slice(0, 1).FirstOrDefault() == null) {
|
||||||
|
// can't load a content item, ignore the type
|
||||||
|
_orchardServices.Notifier.Information(T("Could not process {0}. Some parts might not be compatible with Orchard 1.4, please update your modules.", contentType));
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// migrating parts
|
||||||
_contentDefinitionManager.AlterTypeDefinition(contentType,
|
_contentDefinitionManager.AlterTypeDefinition(contentType,
|
||||||
builder => builder
|
builder => builder
|
||||||
.WithPart("AutoroutePart")
|
.WithPart("AutoroutePart")
|
||||||
.WithPart("TitlePart"));
|
.WithPart("TitlePart"));
|
||||||
|
|
||||||
var count = 0;
|
var count = 0;
|
||||||
var isContainable = false;
|
var isContainable = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user