Skip to:
Content
Pages
Categories
Search
Top
Bottom

Saving xprofile with empty required fields doesn’t return an error message


  • dro-i-de
    Participant

    @dro-i-de

    Hi!

    Firstly, some info:
    WP: 4.9.4 Theme: Eonet (child theme)
    Buddypress: 2.9.3

    Domov

    I have a problem when saving xprofile data on the frontend. I have created a group and in it a bunch of required fields.
    When I try to save the fields on the frontend (Eonet theme) it doesn’t throw any errors. If I fill out all the required fields, the message appears saying the changes have been saved and sure enough, the database holds the correct values.
    I tried switching to a default Twenty Seventeen theme and deactivated all the plugins, but the problem still persists, with one crucial difference: the fields that are required and are empty, actually get saved as empty – which is not the correct behaviour.

    Can you confirm that required fields are actually required to be filled?

    Thank you for your help,

    Best regards,
    Domen

Viewing 3 replies - 1 through 3 (of 3 total)

  • Venutius
    Moderator

    @venutius

    BuddyPress does not come with this as a feature, so BP would not have the code to check for required fields and enforce them in the group. How did you create the fields?


    pedger
    Participant

    @pedger

    I have the same issue. Apart from the Name field, all new fields marked as required doesn’t throw errors when the user saves its profile on either on frontend and backend.

    I created the fields using User > Profile fields tool, where there’s a required option. The input elements on the frontend even has ‘aria-required=”true”‘ param.

    In my case, when the user leaves a field empty (i.e. deletes the info that was there previously, the db entry is simply deleted. (agreed with @dro-i-de, not the expected behavior)

    How xprofile handles the fields marked as required?

    running WP 4.9.4 Theme: Boss (child Theme) 2.4.2
    Buddypress: 2.5.14


    pedger
    Participant

    @pedger

    @dro-i-de aparently this is a feature not a bug. If the user editing the fields has a bp_moderate capability, it is allowed to save empty fields. Your regular users will not.

    Found it here: https://buddypress.trac.wordpress.org/ticket/7483#comment:6

    I tested and it works as expecteded.

    Cheers

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