Too Many Fields?

This topic contains 4 replies, has 2 voices, and was last updated by  Alex Rollin 5 years, 11 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #2361

    Lauren Magnuson
    Free User
    Post count: 2

    Hi, I’m using UsersWP in possibly an unusual way – we’re tracking user skills, and have over 250 skills we’ve started adding to UsersWP as custom fields (radio buttons)

    Once we’ve added approximately 60 skills, we start to see some strange behavior. When editing fields, we see this message:

    Column change failed, you may have too many columns.

    And the default values don’t seem to populate.

    Have you found there’s a limit to how many fields can be added to the user table in WordPress?

    #2362

    Lauren Magnuson
    Free User
    Post count: 2

    After getting into the SQL database, I see the problem – each of my custom profile fields is VARCHAR 254, so after approximately 60 of those fields we hit SQL error 1118. I’m manually paring down those fields to VARCHAR 25 because that’s way more than the characters of any of my radio button options that I’ll need, but I noticed in class-formbuilder.php that the default new field is set to VARCHAR 254, which seems to be applying to radio buttons (the other field type seem to calculate the max characters needed for the field on the fly using the $op_max variable, but please correct me if I’m reading that wrong).

    I don’t want to ‘hack core’ and make changes that will prevent me from updating this plugin – any suggestions for how I might hook into this and write my own add-on that would enable me to have a whole bunch of fields?, or would you possibly consider writing an enhancement or accepting a pull request? What I’m interested in doing is possibly breaking up the profile form into multiple pages/tables, which would give more space for all the crazy fields I need to store.

    Thanks (and thanks for a totally awesome plugin, BTW!)

    Lauren

    #2367

    Alex Rollin
    Moderator
    Post count: 27815

    Hi!

    You make some good points about the field settings and we will take a look at that for future versions.

    When you go to the profile, then click account, you can see the link to ‘privacy’.

    This is an example of a subform. You could look into the code to see how that is created to get some ideas.

    Certainly managing your fields in code would give you more control over them!

    #2392

    Lauren Magnuson
    Free User
    Post count: 2

    Right on, thanks Alex! How do I edit the “Privacy” subform? or create one that is similar?

    Thanks again,

    Lauren

    #2393

    Alex Rollin
    Moderator
    Post count: 27815

    The “Privacy” sub page and checkbox is an example:
    https://github.com/UsersWP/userswp/search?utf8=%E2%9C%93&q=privacy&type=

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

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

Open Support Ticket