(1)
Users > Users > Save
Error saving user (check log)
This error occurs because the "Sections" Checkbox list items lose their selected state.
I think this is a mono oddity. In fact, the checkbox list state is intact during
postback in Page_Load but is lost during validation, and during page rendering.
Here's the fix: it is a little clunky but it does work.
In .../umbraco/presentation/umbraco/users/EditUser.aspx.cs, modify sectionValidator_ServerValidate(...), and add after line 218,
setCheckBoxStates(lapps);
Then also add these:
//mono fix for lost checkboxlist states
private void setCheckBoxStates(CheckBoxList cbl)
{
if (IsPostBack)
{
string cblFormID = cbl.ClientID.Replace("_","$");
int i = 0;
foreach (var item in cbl.Items)
{
string itemSelected = Request.Form[cblFormID + "$" + i];
if (itemSelected != null && itemSelected != String.Empty)
((ListItem)item).Selected = true;
i++;
}
}
}
protected void Page_PreRender(object sender, EventArgs e)
{
setCheckBoxStates(lapps);
}
(2)
Settings > Document Types > Structure > Allowed child nodetypes Checkboxes state is not retained during save. This is the same issue as above. In .../umbraco/presentation/umbraco/controls/ContentTypeControlNew.aspx insert before line 285,
setCheckBoxStates(lstAllowedContentTypes);
and also add
//mono fix for lost checkboxlist states
private void setCheckBoxStates(CheckBoxList cbl)
{
if (IsPostBack)
{
string cblFormID = cbl.ClientID.Replace("_","$");
int i = 0;
foreach (var item in cbl.Items)
{
string itemSelected = Request.Form[cblFormID + "$" + i];
if (itemSelected != null && itemSelected != String.Empty)
((ListItem)item).Selected = true;
i++;
}
}
}
(3)
Settings > Document Types > Info > Allowed Templates
Checkboxes state is not retained during save.
This looks like a mono oddity. When OnBubbleSave fires in
.../umbraco/presentation/umbraco/settings/EditNodeTypeNew.aspx,
the state of the checkbox is not available. We use the setCheckBoxStates(CheckBoxList cbl) fix.
In .../umbraco/presentation/umbraco/settings/EditNodeTypeNew.aspx insert before line 120,
setCheckBoxStates(templateList);
and also add
//mono fix for lost checkboxlist states
private void setCheckBoxStates(CheckBoxList cbl)
{
if (IsPostBack)
{
string cblFormID = cbl.ClientID.Replace("_","$");
int i = 0;
foreach (var item in cbl.Items)
{
string itemSelected = Request.Form[cblFormID + "$" + i];
if (itemSelected != null && itemSelected != String.Empty)
((ListItem)item).Selected = true;
i++;
}
}
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.