[buddypress-trac] [BuddyPress Trac] #6426: 'fields' => 'ids' for activity queries

buddypress-trac noreply at wordpress.org
Tue Aug 18 20:03:02 UTC 2015


#6426: 'fields' => 'ids' for activity queries
----------------------------------+------------------
 Reporter:  boonebgorges          |       Owner:
     Type:  enhancement           |      Status:  new
 Priority:  normal                |   Milestone:  2.4
Component:  Component - Activity  |     Version:
 Severity:  normal                |  Resolution:
 Keywords:  has-patch             |
----------------------------------+------------------

Comment (by r-a-y):

 > Had to add a bunch of isset checks everywhere to avoid notices
 (particularly the activity action callbacks) since a dev might not be
 fetching all fields.

 I've updated `02.patch` to be a bit cleaner.

 Instead of all the `isset` checks, I'm now doing this in
 `BP_Activity_Activity::get()`:


 {{{
                 // Generate action strings
                 if ( empty( $fields ) || in_array( 'action', $fields, true
 ) ) {
                         $activities =
 BP_Activity_Activity::generate_action_strings( $activities );
                 }
 }}}

 If you're not asking for the `'action'` field in the `fields` parameter,
 we don't need to generate the action strings to begin with :)

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6426#comment:8>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list