Jump to:

5450 Posts in 1672 Topics by 1197 members

Customising the CMS

SilverStripe Forums » Customising the CMS » complex table field strange behavior when checking/unchecking items

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1126 Views
  • Aram
    Avatar
    Community Member
    598 Posts

    complex table field strange behavior when checking/unchecking items Link to this post

    I have recently been noticing very strange behavior is some of my CTF when checking and unchecking objects in them.

    They will only save as checked the items which are changed, and will uncheck any other items, even if they are still checked when saving. So in other words if I had 5 items and the first 3 were checked, in order to get all 5 checked after saving, I would have to uncheck the first 3 and check the last 2!

    Thats probably pretty confusing! So here is a couple of examples:

    Example 1
    Open page:
    Item1: Checked
    Item2: Checked

    Change to:
    Item1: Checked
    Item2: UnChecked

    Save page and reload becomes:
    Item1: UnChecked
    Item2: Checked

    Example 2
    Open page:
    Item1: Checked
    Item2: Checked
    Item3: UnChecked
    Item4: UnChecked

    Change to:
    Item1: UnChecked
    Item2: UnChecked
    Item3: Checked
    Item4: Checked

    Save page and reload:
    Item1: Checked
    Item2: Checked
    Item3: Checked
    Item4: Checked

    Its pretty mind boggling before you know whats going on and even then its a real pain, especially if your table is filtered so to only show items accociated with that page, one wrong click and you can lose the whole lot, with the only way to get them back being to edit the database.

    I have had this problem with a number of installs both on my local windows env and on my live linux server all using 2.23.

    has anyone else seen this behavior?

  • SilverRay
    Avatar
    Community Member
    167 Posts

    Re: complex table field strange behavior when checking/unchecking items Link to this post

    Yes, I see this behavior sometimes (also with 2.3 RC2). I don't have a solution, really, other than reloading the cms with ?flush=1. That sometimes helps. I posted about this problem earlier as well (and talked about it during IRC chat hours) but that didn't get anywhere either...

  • Fuzz10
    Avatar
    Community Member
    786 Posts

    Re: complex table field strange behavior when checking/unchecking items Link to this post

    Did not bump into this myself, but eeh...

    This sounds like a pretty huge issue , no ?

    Did you create a ticket ?

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: complex table field strange behavior when checking/unchecking items Link to this post

    Yea it does seem like a pretty major bug, just wanted to check it wasn't just me before I made a ticket

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: complex table field strange behavior when checking/unchecking items Link to this post

    ok thanks to ajshort for pointing me to this ticket with a solution: http://open.silverstripe.com/ticket/2723

    Open sapphire/javascript/RelationComplexTableField.js

    and move these two declarations at the top of the page:

    var checkedListNameArray = null;
    var checkedArray = null;

    to inside the function like this:

    RelationComplexTableField = Class.create();
    RelationComplexTableField.prototype = {

       initialize: function() {
          
          var checkedListNameArray = null;
          var checkedArray = null;

    Not sure why they wouldn't have added this to 2.3, but anyway is simple enough change

    1126 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.