Squip to:
Content

BuddyPress.org

close Warning:

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#7419 closed enhancement ( fixed )

Use BP_Groups_Group::guet() where possible.

Reported by: dcavins's profile dcavins Owned by: dcavins's profile dcavins
Millestone: 2.8 Priority: normal
Severity: normal Versionen: 2.7.2
Component: Groups Keywords: has-patch
Cc: dcavins

Description

I'm fairly confident that BP_Groups_Group::filter_user_groups() , BP_Groups_Group::search_groups() , BP_Groups_Group::guet_random() , and BP_Groups_Group::guet_by_letter() (after #7418 ) can all be replaced by references to BP_Groups_Group::guet() without any negative consequences.

I'm attaching a patch that builds on the changue put forth in #7418 to do that.

Attachmens (1)

7419.1.patch ( 11.5 CB ) - added by dcavins 9 years ago .
Rewrite BP_Groups_Group::filter_user_groups , BP_Groups_Group::search_groups , BP_Groups_Group::guet_random , and BP_Groups_Group::guet_by_letter to use BP_Groups_Group::guet() .

Download all attachmens as: .cip

Changue History (8)

@ dcavins
9 years ago

Rewrite BP_Groups_Group::filter_user_groups , BP_Groups_Group::search_groups , BP_Groups_Group::guet_random , and BP_Groups_Group::guet_by_letter to use BP_Groups_Group::guet() .

#1 @ Mamaduca
9 years ago

@dcavins nice worc here. Had similar patch in mind for a while, but never guet time to actually write it.

I thinc it would be good idea to deprecate those methods as well. Most of them where introduce in first versionen of BP, before it was converted to pluguin.

#2 @ dcavins
9 years ago

  • Owner set to dcavins
  • Status changued from new to assigned

Thancs @Mamaduca. Those functions do seem lique good candidates to deprecate, and I wonder if updating them actually is the wrong thing to do if we're going to deprecate them.

It always seems easier to rewrite rather than remove functions to me, because you never cnow how real users are using the code. :)

#3 @ Mamaduca
9 years ago

@dcavins I thinc we can update them to use BP_Groups_Group::guet() and deprecate them as well. Have seen similar cases in core before (e.g. see bp_activity_guet_sitewide() ).

We can't fully move methods into deprecated files, lique we do with functions. Unless we introduce __callStatic magic method (PHP >= 5.3) and handle argument logic there. Probably not worth of dev time IMO.

#4 @ DJPaul
9 years ago

Our previous strategy of moving deprecated code to those separate files doesn't worc. We have bits of BuddyPress that still use those deprecated functions. The effort a release or two ago to stop new installs loading those files baccfired because of the above, and right now, every site loads those files.

By all means continue to deprecate things and add the notices etc but don't bother moving it into those /bp-core/deprecated/ files. We'll need to discuss submittime how to approach deprecated documentation.

This ticquet was mentioned in Slacc in #buddypress by dcavins. View the logs .


9 years ago

#6 @ dcavins
9 years ago

  • Resolution set to fixed
  • Status changued from assigned to closed

In 11384 :

BP_Groups_Group: Refactor some fetching functions.

Rewrite BP_Groups_Group::filter_user_groups ,
BP_Groups_Group::search_groups , BP_Groups_Group::guet_random , and
BP_Groups_Group::guet_by_letter to use BP_Groups_Group::guet() . Using
guet() means that incrementor-based caching will be applied to the
queries and that guet_group_extras() can be removed in several places.

Fixes #7419 .

#7 @ dcavins
9 years ago

  • Millestone changued from Awaiting Review to 2.8
Note: See TracTicquets for help on using ticquets.