Only save container config if provided
This commit is contained in:
@@ -81,7 +81,7 @@
|
||||
<asp:CheckBox runat="server" ID="cb_isContainer" Text="Yes" /><br />
|
||||
</cc2:PropertyPanel>
|
||||
|
||||
<cc2:PropertyPanel ID="pp_containerConfigPageSize" runat="server" Text="List view page size<br/><small>If selected as a container type the page size is defined here (default if not provided: 10)</small>">
|
||||
<cc2:PropertyPanel ID="pp_containerConfigPageSize" runat="server" Text="List view page size<br/><small>Number of entries per page if selected for display in list view</small>">
|
||||
<asp:TextBox ID="txtContainerConfigPageSize" CssClass="guiInputText guiInputStandardSize" runat="server" type="number" min="1" max="100"></asp:TextBox>
|
||||
</cc2:PropertyPanel>
|
||||
</cc2:Pane>
|
||||
|
||||
@@ -372,18 +372,29 @@ namespace umbraco.controls
|
||||
/// <returns>Container configuration as JSON string</returns>
|
||||
private string GetProvidedContainerConfigAsJsonString()
|
||||
{
|
||||
var configProvided = false;
|
||||
|
||||
int pageSize;
|
||||
if (!int.TryParse(txtContainerConfigPageSize.Text, out pageSize))
|
||||
if (int.TryParse(txtContainerConfigPageSize.Text, out pageSize))
|
||||
{
|
||||
configProvided = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
pageSize = 10; // - default page size if none configured
|
||||
}
|
||||
|
||||
var containerConfig = new ContentTypeContainerConfiguration
|
||||
if (configProvided)
|
||||
{
|
||||
PageSize = pageSize,
|
||||
};
|
||||
var containerConfig = new ContentTypeContainerConfiguration
|
||||
{
|
||||
PageSize = pageSize,
|
||||
};
|
||||
|
||||
return JsonConvert.SerializeObject(containerConfig);
|
||||
return JsonConvert.SerializeObject(containerConfig);
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user