Skip to:
Content

BuddyPress.org

Opened 12 years ago

Closed 10 years ago

Last modified 10 years ago

#5778 closed enhancement (wontfix)

Post Form, user without groups

Reported by: SGr33n Owned by:
Priority: normal Milestone:
Component: Templates Version:
Severity: normal Keywords: has-patch
Cc:

Description

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 12 years ago.
5778.02.patch​ (720 bytes ) - added by r-a-y 11 years ago.

Download all attachments as: .zip

Change History (11)

#1 @SGr33n
12 years ago

  • Summary Post Form, user without without groups → Post Form, user without groups

#2 @DJPaul
12 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
12 years ago

  • Component Core → Theme
  • Milestone Awaiting Review → Future Release
  • Type defect (bug) → enhancement

#4 @SGr33n
12 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

refresh_total_group_count_for_user

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 12 years ago by SGr33n (previous) (diff)

#5 @DJPaul
11 years ago

  • Keywords needs-patch added; has-patch removed

#6 @r-a-y
11 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.

@r-a-y
11 years ago

#7 @DJPaul
10 years ago

  • Component Appearance - Template Parts → Templates

#8 @DJPaul
10 years ago

  • Milestone Future Release
  • Resolution → wontfix
  • Status new → 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
10 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.