Select field value not displaying the option that was previously saved

This topic contains 7 replies, has 3 voices, and was last updated by  Patrik 4 years, 5 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #5783

    Andy
    Free User
    Post count: 46

    Using the Account form builder I’ve added a simple Select field with two values – see attached screenshot.

    When testing this I have found that the value selected by the user is saved into the wp_uwp_usermeta table just as you would expect.

    However when the user goes back to the account page the value shown is not the one they chose before – it is simply showing the first option on the list.

    I’ve tested this with a select list that has only the display text (Option Values = blue,red,yellow,orange) and that works OK.

    I’ve also tested it with a select list that has one-word display text and values (Option Values = car/1,bus/2,truck/3,lorry/4) and that is also OK.

    Final test I did was also OK (Option Values = oneword/1,two words/2,three words here/3,four words go here/4)

    So it seems to be something to do with the longer display text somehow triggering a bug so the saved option is not correctly displayed?

    #5794

    Alex Rollin
    Moderator
    Post count: 27815

    Thanks for reporting, we will look into it.

    #5805

    Patrik
    Moderator
    Post count: 1971

    Hi,

    Yes, the column has type varchar(19) which means string length should be less than 19. You can fix this by modifying that column structure to varchar(255) or whatever you think will be the max length of your label. We have not thought of such a big label so we have kept it to 19. For specific requirements, it can be changed from the database table called wp_uwp_usermeta->Strucutre.

    Regards,
    Patrik

    #5806

    Andy
    Free User
    Post count: 46

    Hi Patrik,

    Actually the field is defined as VARCHAR(49) in wp_uwp_usermeta and the values stored are actually only ‘0’ or ‘1’ anyway. Screenshot attached. (I didn’t set it to VARCHAR(49) manually, that’s how I found it).

    I tried upping it to VARCHAR(255) and it didn’t fix the problem.

    Is there somewhere else where a limit is kicking in?

    Thanks,
    Andy

    #5810

    Patrik
    Moderator
    Post count: 1971

    It works fine on our test site. Kindly provide FTP and admin details in private reply to troubleshoot the issue on your site.

    Regards,
    Patrik

    #5811

    Patrik
    Moderator
    Post count: 1971

    Can you try with the value other than “0” and let me know if it works for you or not?

    Regards,
    Patrik

    #5813

    Andy
    Free User
    Post count: 46

    Hi Patrik,

    Yes it does work fine if I switch “0” to “no” instead.

    Sounds like you have an is_empty() check somewhere, which will treat “0” as empty of course.

    So this bug should trigger for any options with a value of zero – my test cases were focusing on length so I didn’t spot I was also changing the zero to other values.

    Thanks

    #5815

    Patrik
    Moderator
    Post count: 1971

    Yes, and we have made changes for that and will release an update soon.

    Regards,
    Patrik

Viewing 8 posts - 1 through 8 (of 8 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket