Skip to:
Content
Pages
Categories
Search
Top
Bottom

Group admin cannot send invites on multilingual WP


  • myshanai
    Participant

    @myshanai

    I am having problem in my Buddypress Group where group admins cannot send invites.
    Group admin can enter the Invite Members page, select members to invite, then clicked on Send Invites link with number of members to invite. Then a form appears to enter optional messages. Upon clicking the Send button there, a red alert shows that “Invitation failed for (number) users”. On buddypress version 6, the message was “You are not allowed to send invitations for this group”.

    This happens on multilingual installation of WordPress (using WPML) and not selecting the default (English) language. If I choose English, the problem does not happen. I do translate some of the words there for non english version, but could it be the source of the problem?

    Upon debugging into function bp_nouveau_ajax_send_group_invites(), it seems that function bp_get_current_group_id() and $_POST[group_id] both returns group_id = 0

    Any idea on how i could fix this?

    current version:
    wordpress: 5.6
    buddypress: 7.1.0

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

  • myshanai
    Participant

    @myshanai

    I have tested it using superuser/website admin login, the problem still occurs.
    I have tested it using default themes (WP twenty twenty one), the problem still occurs.


    myshanai
    Participant

    @myshanai

    I have tested it on public group, the problem also happen there

    Hi,

    It looks like bp_get_current_group_id() doesn’t manage to guess the Group ID out of the Group’s URL when using Ajax. That’s probably because your plugin is adding extra characters into the URL like the short language name.

    You could try filtering bp_uri when doing Ajax to replace these extra characters with nothing.

    eg:

    
    function myshanai_wpml_ajax_fix( $path ) {
       if ( wp_doing_ajax() ) {
          $extracharacters = ''; // replace with the language short name.
          $path = str_replace( $extracharacters, '', $path );
       }
    
       return $path;
    }
    add_filter( 'bp_uri', 'myshanai_wpml_ajax_fix' );
    

    jordirubio
    Participant

    @jordirubio

    Hello,
    I’m having exactly the same problem. Did you guys find a solution yet?
    BTW, I tried @imath fix by adding it to functions.php without any luck.
    Thanks!


    markcummins
    Participant

    @comminski

    We ran into this problem as well, we have BP installed along with WPML and the BuddyPress Multilingual Plugin.

    The problem for us was that the url’s were different. In english, the url was ‘/community/groups/’ where in French it was ‘/fr/communaute/groupes/’.

    So the solution for us was to go to the backend and change the slugs of the pages so they are the same for all languages, (so english is ‘/community/groups/’ and french is ‘fr/community/groups/’.

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