Bug in Cloneable Field

Support MB Settings Page Bug in Cloneable Field

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #5339
    aboutsourceaboutsource
    Participant

    Hello,
    there seems to be a bug, when using cloneable field in a settings page. When I already have some items in my list and I remove one of the first items (not the last item) I am not able to add any item to my list anymore.
    There seems to be a problem with the indexes. They are not sanitized properly. When I delete i.e. the second item in a list of 3 items the remaining indexes are 0 and 2 (instead of 0 and 1). When adding a new item its index is also 2 and overwrites the existing item with same index.
    This problem does not occur when adding the same metabox to a post.

    This is my simple cloneable field:

    array (
      0 => 
      array (
        'name' => 'My name',
        'id' => 'my-id',
        'type' => 'select',
        'placeholder' => '- Please select -',
        'clone' => true,
        'max_clone' => 4,
        'sort_clone' => true,
        'options' => 
        array (
          'option1' => 'option1',
          'option2' => 'option2',
          'option3' => 'option3',
          'option4' => 'option4',
        ),
        'std' => 
        array (
          0 => 'option1',
          1 => 'option2',
          2 => 'option3',
          3 => 'option4',
        ),
      )
     );
    #5347
    Anh TranAnh Tran
    Keymaster

    Hi,

    You're right. The indexes for cloned values are not reset properly when saving. I've just updated the extension with a fix for that. Please update.

    #5352
    aboutsourceaboutsource
    Participant

    Perfect! It works now. Thank you very much!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Bug in Cloneable Field’ is closed to new replies.