Improving error messages in migration module

--HG--
branch : autoroute
This commit is contained in:
Sebastien Ros
2012-02-07 18:01:43 -08:00
parent f5f2df8100
commit 0e56e0fd64
@@ -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;