Custom Fields
Re-Envisioned
Support MB Custom Table Switch fields always saves as true (1)

  • Creator
    Topic
  • #19336
    Resolved webmatic
    Participant

    Hi, using a custom table that worked perfectly for quite a while the switch fields now always save as true (value 1 in the custom table). Text fields (from the same metabox as the switches) are updated just normal, so it isn’t the link to the custom table that is the culprit imho.
    Please anybody an idea?
    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #19345
    Long Nguyen
    Moderator

    Hi,

    Could you please let me know the data type of column which saves switch value? I’m just using type INT and it saves the value 0 and 1 as well, see my screenshot https://cl.ly/54c9e116ec61

    Here is the sample code https://pastebin.com/nvMFeqKD

    #19362
    webmatic
    Participant

    Hi,
    thank you so much. This was the spot I needed to look at.
    I’ve changed the datatype to integer and everything is back up and running.
    What I don’t get is that I’ve used the bit-datatype for a few years and never had this problem. But anyway, it’s fixed 🙂
    thanks!

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