Skip to content

sorting problem saving sortable multi select field with wp pages: #1865

@w3b-beweb

Description

@w3b-beweb

Debug info:

  • Redux version: the very last 😄 (3.3.9.10)
  • Wordpress 4.0.1
  • Redux not in dev_mode
  • Redux embedded in my theme
  • no js or php warnings/errors

In my redux config I've a sortable multi-select field, filled up with Wordpress pages; here's the code:

array(
    'id'            => 'oweb_opts_home_feat_pages_1',
    'type'          => 'select',
    'multi'         => true,
    'sortable'      => true,
    'title'         => 'Pages',
    'subtitle'      => 'select which page(s) you want to feature on homepage',
    'data'          => 'pages',
    'required'      => array('oweb_opts_home_feat_1_type','equals','0'),
    'placeholder'   => 'Select one or more'
),

All seems to work well (the "required" condition, the multiselect and UI reorder features etc) BUT the ids of selected elements are always saved in the same order, regardless of the order selected via UI. Here is a dump of the saved option (the same every time) with 3 pages selected:

'oweb_opts_home_feat_pages_1' => array (3)
    string (4) "1565"
    string (4) "1550"
    string (4) "1526"

they are always sorted in chronological reverse order, no matter what I do during selection. It seems very odd to me there's a bug like this, so am I missing something obvious (not for me!)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions