mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Adding content item existence check for WidgetPart infoset migration
This commit is contained in:
@@ -403,13 +403,15 @@ namespace Upgrade.Controllers {
|
|||||||
_upgradeService.ExecuteReader("SELECT TOP " + BATCH + " * FROM " + widgetsTable + " WHERE Id > " + id,
|
_upgradeService.ExecuteReader("SELECT TOP " + BATCH + " * FROM " + widgetsTable + " WHERE Id > " + id,
|
||||||
(reader, connection) => {
|
(reader, connection) => {
|
||||||
lastContentItemId = (int)reader["Id"];
|
lastContentItemId = (int)reader["Id"];
|
||||||
var contentPermissionPart = _orchardServices.ContentManager.Get(lastContentItemId);
|
var widgetPart = _orchardServices.ContentManager.Get(lastContentItemId);
|
||||||
|
|
||||||
contentPermissionPart.As<InfosetPart>().Store("WidgetPart", "Title", (string)reader["Title"]);
|
if (widgetPart != null) {
|
||||||
contentPermissionPart.As<InfosetPart>().Store("WidgetPart", "Position", (string)reader["Position"]);
|
widgetPart.As<InfosetPart>().Store("WidgetPart", "Title", (string)reader["Title"]);
|
||||||
contentPermissionPart.As<InfosetPart>().Store("WidgetPart", "Zone", (string)reader["Zone"]);
|
widgetPart.As<InfosetPart>().Store("WidgetPart", "Position", (string)reader["Position"]);
|
||||||
contentPermissionPart.As<InfosetPart>().Store("WidgetPart", "RenderTitle", (bool)reader["RenderTitle"]);
|
widgetPart.As<InfosetPart>().Store("WidgetPart", "Zone", (string)reader["Zone"]);
|
||||||
contentPermissionPart.As<InfosetPart>().Store("WidgetPart", "Name", reader["Name"] as string);
|
widgetPart.As<InfosetPart>().Store("WidgetPart", "RenderTitle", (bool)reader["RenderTitle"]);
|
||||||
|
widgetPart.As<InfosetPart>().Store("WidgetPart", "Name", reader["Name"] as string);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user