Metabox switch not saving when in Metabox grouping on MB settings page

Support MB Settings Page Metabox switch not saving when in Metabox grouping on MB settings page

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #15354
    alpha.mediaalpha.media
    Participant

    Hello,

    We have a situation where when you clone a new group and set the toggle switch within the group, then save the MB settings page, the toggle switch value does not save in the database. However, after the first page save, once the screen has refreshed, and you save the switch again then it will save to the database. Do you have any hints, clues, or ideas as to what could be the cause? The JS console, PHP debug log, and network list show no errors. Would appreciate any help you can offer.

    #15362
    Anh TranAnh Tran
    Keymaster

    Hi,

    Did you mean 'toggle switch' = the group bar collapse element, or is that a switch field type?

    Can you post a screenshot/video here?

    #15369
    alpha.mediaalpha.media
    Participant

    I can't really post a video, but it is the switch type field. First, it's an MB settings page and to reproduce the error I:

    • Add a new group ( i.e. add clone )
    • Set the toggle switch type field to true
    • Save settings

    After the page has saved and refreshed, it does not show the setting saved. I then set the toggle switch type field to true, save, and it saves correctly. I am trying to understand why it does not save the first time.

    #15380
    Anh TranAnh Tran
    Keymaster

    Hi,

    Here is a video that I created for testing:

    https://www.loom.com/share/e519722638ed4cb299106b56ee83be8f

    Just a note that if you clone a group and if all the child fields have no values, then that clone won't be save. That might be the case.

    #15389
    alpha.mediaalpha.media
    Participant

    Can this be fixed or is it just something we have to live with? Also, thank you for video!

    #15395
    Anh TranAnh Tran
    Keymaster

    What do you mean "can this be fixed"? It's the default behavior of the MB Group, to prevent saving empty values. It's not a bug.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.