Skip to:

Opened 10 years ago

Closed 8 years ago

Last modified 8 years ago

#5778 closed enhancement (wontfix)

Post Form, user without groups

Reported by: sgr33n's profile SGr33n Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Templates Keywords: has-patch


Hi :)

On BuddyPress if the user have no groups, the post update form will show a select field with just one option. This will show the select field only if the user has groups. Just added bp_get_total_group_count_for_user() > 0 to the conditions.

Attachments (2)

post-form-0-groups.patch (590 bytes) - added by SGr33n 10 years ago.
5778.02.patch (720 bytes) - added by r-a-y 9 years ago.

Download all attachments as: .zip

Change History (11)

#1 @SGr33n
10 years ago

  • Summary changed from Post Form, user without without groups to Post Form, user without groups

#2 @DJPaul
10 years ago

I think a decent idea but the function you added ends up calling a (cached) DB query, which isn't ideal. Have you looked through the buddypres() global at this point of execution, and see if there are any existing properties set which we could use to do the same thing?

#3 @DJPaul
10 years ago

  • Component changed from Core to Theme
  • Milestone changed from Awaiting Review to Future Release
  • Type changed from defect (bug) to enhancement

#4 @SGr33n
10 years ago

You're right, I didn't see the function source... anyway I can see that it uses

class BP_Groups_Member

that has a


Now, do you know if when a user joins a group this refresh is called? In this case I suppose that the cache should always be in sync... on the opposite case do you think that count total groups on every page where there is a whats-new form could be too heavy?

Last edited 10 years ago by SGr33n (previous) (diff)

#5 @DJPaul
9 years ago

  • Keywords needs-patch added; has-patch removed

#6 @r-a-y
9 years ago

  • Keywords has-patch added; needs-patch removed

I do not see a problem with using a cached count function here.

We use bp_get_total_group_count_for_user( bp_loggedin_user_id() ) on the groups directory for the "My Groups" tab and that is almost the same use case here.

9 years ago

#7 @DJPaul
8 years ago

  • Component changed from Appearance - Template Parts to Templates

#8 @DJPaul
8 years ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

@hnla @imath can you check for this issue in the new template pack, and if it exists, move this issue to github?

I don't want to make this change to BP-Legacy any more.

#9 @imath
8 years ago

@DJPaul just checked, we are using an autocomplete control in BP Nouveau instead of the select box. And i've just checked we don't have this issue in BP Nouveau.

If the user has no groups, the control to post in profile or in groups is not displayed. So we're fine :)

Note: See TracTickets for help on using tickets.