0

在将内容/元数据从 ORchard CMS 1.9.1 导入到早期版本 1.7 时,每当我导出小部件时,都会抛出如下所示的错误:

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 20:                 @if (count > 0) {
Line 21:                     int i = 0;
Line 22:                     foreach (WidgetPart widget in widgets.Where(w => w.Zone == zone).OrderBy(w => w.Position, new Orchard.UI.FlatPositionComparer())) {
Line 23:                         <li class="widgets-@(widget.LayerId == Model.CurrentLayer.Id ? "this" : "other")-layer widgets-layer-@widget.LayerId@(i == 0 ? " first" : (i == count ? " last" : ""))">
Line 24:                             @using (Html.BeginFormAntiForgeryPost()) {


Source File: e:\inetpub\wwwroot\TestWebsite\Modules\Orchard.Widgets\Views\WidgetPlacement.Zones.cshtml    Line: 22 

每当我导出我的任何小部件时,都会发生此错误。你能帮我理解导出小部件的步骤吗?在导出小部件之前我还需要导出什么?

4

1 回答 1

1

可能是 1.9.1 的导出与 1.7 不兼容,您必须比较 1.9.1 的导出和 1.7 的导出,看看有什么不同。

或者,您可能正在将小部件导入尚不存在的图层,当您加载小部件管理页面时也会引发错误。

于 2015-10-07T09:11:10.417 回答