diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js index 8789dc1adb..ff1da85a0c 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/listview/listview.controller.js @@ -29,16 +29,21 @@ function listViewController($rootScope, $scope, $routeParams, $injector, notific items: [] }; + // Set default default options (i.e. those if no container configuration has been saved) + $scope.options = { + pageSize: 10, + pageNumber: 1, + filter: '', + orderBy: 'UpdateDate', + orderDirection: "desc" + }; + // Retrieve the container configuration for the content type and set options before presenting initial view contentTypeResource.getContainerConfig($routeParams.id) .then(function (config) { - $scope.options = { - pageSize: config.pageSize, - pageNumber: 1, - filter: '', - orderBy: 'UpdateDate', - orderDirection: "desc" - }; + if (typeof(config.pageSize) !== 'undefined') { + $scope.options.pageSize = config.pageSize; + } $scope.initView(); }); diff --git a/src/Umbraco.Web/Editors/ContentAndMediaTypeBaseController.cs b/src/Umbraco.Web/Editors/ContentAndMediaTypeBaseController.cs index 8fb752916f..1601d6f0f1 100644 --- a/src/Umbraco.Web/Editors/ContentAndMediaTypeBaseController.cs +++ b/src/Umbraco.Web/Editors/ContentAndMediaTypeBaseController.cs @@ -41,7 +41,12 @@ namespace Umbraco.Web.Editors throw new HttpResponseException(HttpStatusCode.NotFound); } - return JsonConvert.DeserializeObject(contentItem.ContentType.ContainerConfig); + if (!string.IsNullOrEmpty(contentItem.ContentType.ContainerConfig)) + { + return JsonConvert.DeserializeObject(contentItem.ContentType.ContainerConfig); + } + + return null; } } } \ No newline at end of file