Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Warning: CheckBoxListEditor is broken by latest Episerver patches (7.9.x+)

Vote:
 

A word of warning about upgrading episerver with custom editor descriptors.

I have a custom editor descriptor that renders a list of checkboxes using epi-cms.contentediting.editors.CheckBoxListEditor dojo-script. It used to work fine until patch 7.8.0, but with later patches (7.9.x+) it no longer saves all the selections. Usually only the first selections are saved while subsequent selections are ignored. I guess the dojo component doesn't notice that the selection has changed after the first selections, especially if you click the checkbox input element instead of label field.

What makes this problem particularly frustrating is that you can't downgrade to 7.8.0 due to database upgrades :D

Has anyone yet solved this issue? The easiest solution would be downgrade to 7.8.0, but that would require scripts to handle the database downgrade too. 

#88942
Aug 04, 2014 17:17
Vote:
 

As proof-of-failure, let's consider following simple ContentDescriptor.

    [EditorDescriptorRegistration(TargetType = typeof(string), UIHint = "CheckBoxTest")]
    public class CheckBoxTestEditorDescriptor : EditorDescriptor
    {
        public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable attributes)
        {
            SelectionFactoryType = typeof(TransportTypesFactory);
            ClientEditingClass = "epi-cms.contentediting.editors.CheckBoxListEditor";
            base.ModifyMetadata(metadata, attributes);
        }
    }
    public class TransportTypesFactory : ISelectionFactory
    {
        public IEnumerable GetSelections(ExtendedMetadata metadata)
        {
            return new List
            {
                    new SelectItem { Value = "foo", Text = "Foo" },
                    new SelectItem { Value = "bar", Text = "Bar" },
                    new SelectItem { Value = "foobar", Text = "FooBar" },
                    new SelectItem { Value = "value1", Text = "Value 1" },
                    new SelectItem { Value = "value2", Text = "Value 2" },
                    new SelectItem { Value = "value3", Text = "Value 3" },
            };
        }
    }

And a simple PageData property that uses the descriptor.

        [UIHint("CheckBoxTest")]
        [Display(
            Name = "Check box test",
            GroupName = SystemTabNames.Content,
            Order = 99)]
        public virtual string CheckBoxTest { get; set; }

If you edit the property on on-page-edit view (using @Html.PropertyFor(m => m.CheckBoxTest)) it works fine, but on the "All properties" tab the values won't always persist. Try selecting the checkboxes by clicking the input element. The values won't persist once saved.

So, seems that one workaround is to render the checkbox-property on on-page-edit view, and discourage editors to change them on "All properties"-tab, that otherwise is very much in use.

#88950
Aug 04, 2014 22:55
Vote:
 

Has anyone experienced the same?

#89334
Aug 13, 2014 15:00
Vote:
 

I'm experiencing the same issue, the values are saved (I can see that when I display them on the page using Html.PropertyFor), but the checkboxes remain unchecked when I view the property. 

#114652
Dec 17, 2014 8:30
Vote:
 

Karoline, try updating to EPiServer.CMS.UI version 7.16.0 if you can. This version seems to fix the problem.

#114659
Dec 17, 2014 14:17
Vote:
 

I've been experiencing this issue for a while now on my 7.8.x site. I thought it was due to the sheer number of options my CheckBoxList property has(~380). My users report that they've managed to work around the issue by clicking on the checkbox labels(not the checkboxes themselves) slowly, one at a time, so as to give the auto save functionality time to kick in.

#114665
Dec 17, 2014 17:35
Vote:
 

Jouni, unfortunately EPiServer.CMS.UI version 7.16.0 is where I'm experiencing this issue. 

#114672
Dec 18, 2014 7:19
Vote:
 

Karoline, hmm.. strange. I just double checked that the issue hasn't regressed, and it hadn't. 

Here is our full packege.config

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Antlr" version="3.4.1.9004" targetFramework="net40" />
  <package id="Castle.Core" version="3.2.2" targetFramework="net40" />
  <package id="Castle.Windsor" version="3.2.1" targetFramework="net40" />
  <package id="DotNetZip" version="1.9.1.8" targetFramework="net451" />
  <package id="EPiServer.CMS.Core" version="7.17.0" targetFramework="net451" />
  <package id="EPiServer.CMS.UI" version="7.16.0" targetFramework="net451" />
  <package id="EPiServer.CMS.UI.Core" version="7.16.0" targetFramework="net451" />
  <package id="EPiServer.Find" version="8.6.0.1055" targetFramework="net451" />
  <package id="EPiServer.Find.Cms" version="8.6.0.1055" targetFramework="net451" />
  <package id="EPiServer.Find.Framework" version="8.6.0.1055" targetFramework="net451" />
  <package id="EPiServer.Framework" version="7.17.0" targetFramework="net451" />
  <package id="EPiServer.Logging.Log4Net" version="0.1.0" targetFramework="net451" />
  <package id="EPiServer.Packaging" version="3.1.5" targetFramework="net451" />
  <package id="EPiServer.Packaging.UI" version="3.1.5" targetFramework="net451" />
  <package id="EPiServer.Search" version="7.6.1" targetFramework="net451" />
  <package id="log4net" version="1.2.10" targetFramework="net40" />
  <package id="Lucene.Net" version="3.0.3" targetFramework="net40" />
  <package id="Microsoft.AspNet.Mvc" version="4.0.30506.0" targetFramework="net40" />
  <package id="Microsoft.AspNet.Razor" version="2.0.30506.0" targetFramework="net40" />
  <package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net451" />
  <package id="Microsoft.AspNet.WebApi" version="5.1.1" targetFramework="net451" />
  <package id="Microsoft.AspNet.WebApi.Client" version="5.1.1" targetFramework="net451" />
  <package id="Microsoft.AspNet.WebApi.Core" version="5.1.1" targetFramework="net451" />
  <package id="Microsoft.AspNet.WebApi.WebHost" version="5.1.1" targetFramework="net451" />
  <package id="Microsoft.AspNet.WebPages" version="2.0.30506.0" targetFramework="net40" />
  <package id="Microsoft.Net.Http" version="2.0.20710.0" targetFramework="net451" />
  <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net40" />
  <package id="Newtonsoft.Json" version="5.0.8" targetFramework="net40" />
  <package id="NuGet.Core" version="2.5.0" targetFramework="net451" />
  <package id="SharpZipLib" version="0.86.0" targetFramework="net40" />
  <package id="structuremap" version="2.6.4.1" targetFramework="net40" />
  <package id="System.IdentityModel.Tokens.ValidatingIssuerNameRegistry" version="4.5.1" targetFramework="net45" />
  <package id="WebGrease" version="1.5.2" targetFramework="net40" />
</packages>
#114682
Dec 18, 2014 10:40
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.