Skip to:
Content

Opened 9 years ago

Closed 9 years ago

#1597 closed defect (bug) (fixed)

Bug: Group Invites Friends

Reported by: _DorsVenabili Owned by:
Milestone: 1.2 Priority: major
Severity: Version:
Component: Keywords: group invite
Cc:

Description

I installed latest trunk buddypress. And I created 3 users: user1, user2 and user3. I created a group logged as User1 and in the step 4 (invites) there is no friends to invite, so I have to click Finish and I have not invited anyone.

After that, if I go to http://example.com/groups/grupo4/send-invites/ and clik on 'Send Invites', I will see the following message: "You either need to build up your friends list, or your friends have already been invited or are current members."

But user1 have 2 friends and no-one is member of that group.

Attachments (4)

Screenshot-invites.png (24.1 KB) - added by _DorsVenabili 9 years ago.
Screenshot-invites2.png (44.1 KB) - added by _DorsVenabili 9 years ago.
Screenshot-invites3.png (45.8 KB) - added by _DorsVenabili 9 years ago.
bp-friends.diff (1.3 KB) - added by _DorsVenabili 9 years ago.

Download all attachments as: .zip

Change History (9)

#1 @_DorsVenabili
9 years ago

Applying the changes of the changeset#2296 and changeset#2295, the second bug disappear and appear again the first one, in other words, if I go to "Send Invites" of a group without members, the following message will be shown: "Select people to invite from your friends list.", but no friends are shown in the list on the left (you can see it in the third attachment file).

#2 follow-up: @_DorsVenabili
9 years ago

Ok, I have found the problem, in the file: wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/send-invites.php in line 29:

<?php if ( bp_group_has_invites() ) : ?>

In the example that I explained above, the function bp_group_has_invites() must to return true and to go inside the 'if' to show the friends' list, instead that, the function returns nothing, it's empty, so it will never show the friends' list, cause it never go inside the 'if'.

#3 in reply to: ↑ 2 @_DorsVenabili
9 years ago

Sorry, the problem is not that function, is: bp_new_group_invite_friend_list(), that one has to show the friends' list and it doesn't show it. The function is in: /wp-content/plugins/buddypress/bp-groups/bp-groups-templatetags.php on line 1700.

#4 @_DorsVenabili
9 years ago

Following the trace, I noticed that the issue cause is not working is in the file: /wp-content/plugins/buddypress/bp-friends.php in the function that starts in line 573:

function friends_get_friends_invite_list( $user_id = false, $group_id )

Inside this function is called the function: $friend_ids = friends_get_alphabetically( $user_id ); (line 579) and after that, the function is calling the array: $friend_idsfriends? but that array DO NOT exists, instead that one, the right name is: $friend_idsusers?.

With this change, now I can see some names in the list to invite to the group, but still doesn't works properly, some names appear twice (but better this than no-one).

#5 @_DorsVenabili
9 years ago

  • Resolution set to fixed
  • Status changed from new to closed

The problem is fixed! :D. Doing the changes of the attached file: bp.friends.diff the friends list is shown and everything is working perfect! :). So when you're creating a new group or when the group is created, the friend's list is shown to invite them.

I'm sorry, I'm a beginner and the diff format is not ok, the function must to start on line 573, but in the diff file start on line 1.

Note: See TracTickets for help on using tickets.