Skip to:
Content
Pages
Categories
Search
Top
Bottom

Editing Field error


  • agundabbo
    Participant

    @agundabbo

    Hi. I have 3 custom fields (required). I want that users can not edit one of them so i put this code as suggested:
    while ( bp_profile_fields() ) : bp_the_profile_field(); if ( get_current_user_id()=#ADMIN ID OR bp_get_the_profile_field_id() != 'ID # YOU WANT TO SKIP' ) :
    But when a user try to edit another field, it pops out this error

    Please make sure you fill in all required fields in this profile field group before saving.

    I think it occurs because the user can not see the hidden fields.

    How can I handle that?
    Regards.

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

  • shanebp
    Moderator

    @shanebp

    >I think it occurs because the user can not see the hidden fields.

    The field is not hidden.
    It doesn’t exist in the form because you skipped it.
    But it is included in the hidden input ‘field_ids’, near the bottom of the form.
    BP will try to save it, based on the fields ids, but not find it and then throw the error.

    Instead of skipping, try changing the field type to hidden.

    If you don’t want it in the form at all, then skip it AND remove it from the string of included ids.
    Use bp_get_the_profile_group_field_ids() and do your removals and then put the new string in the ‘field_ids’ input field.


    agundabbo
    Participant

    @agundabbo

    Thanks for the answer.
    Yeah, infact I figure that later.
    I put a condtion that if the field that “for users would be empty” is empty skips the error zone.
    Something like if field_id != 1 or !empty(field_id,1) something, go normally.
    It seems to work although it is very sloppy anche cheap. 😀

    Thanks again.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Editing Field error’ is closed to new replies.
Skip to toolbar