• Resolved Grant

    (@grant10k)


    There’s a bug where adding Additional fields select options will overwrite previous options instead of adding new ones.

    Repo Steps:

    1. On the dashboard, go to WooCommerce->Checkout
    2. Go to the “additional” tab.
    3. Click on “+ Add New Field”
    4. Under Type, select “Select”
    5. Under options, add three options. ‘a’, ‘b’, and ‘c’.
    6. Select the checbox next to option ‘b’.
    7. Click ‘Delete Selected’.
    8. Add one new option, ‘d’.
    9. Click Save.

    Expected:
    Options a, c, and d to be presented as options

    Actual:
    Options a and d are the only two options.

    What’s happening is internally the options are indexed 0, 1, 2, etc. but if you delete option 1, you’re left with 0 and 2. But if you create a new option, it creates it as index 2, which already exists, and overwrites the previous #2 when you save. It should create the new option as either #3 (the next highest) or #1 (to fill in the ‘missing’ #1).

    This also happens with radio options. Probably any type that uses a list. They all seem to create the newest index the same way.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Updating Additional fields select type options overrides previous options’ is closed to new replies.