[buddypress-trac] [BuddyPress Trac] #8556: BP_Notifications_Notification::get - error for meta_query

buddypress-trac noreply at wordpress.org
Tue Aug 24 06:28:27 UTC 2021


#8556: BP_Notifications_Notification::get    - error for meta_query
--------------------------+-----------------------------
 Reporter:  shawfactor    |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Core          |    Version:
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 Team I have identified an error with BP_Notifications_Notification::get

 When you do a meta query using the above static method the notifciation id
 is no longer avilable in the result as it won't cast as an integer

 my code:

  $meta_query = array(
     array(
         'key' => 'foo_key',
         'compare' => 'NOT EXISTS',
     )
     );

     $args = array(
         'user_id'       =>  $user_ids_array,
         'meta_query'    =>  $meta_query,
         'per_page'      => '1',
         'order_by'      => 'date_notified',
         );

     $notifications = BP_Notifications_Notification::get($args);


 ithe issue saeems to be that it won't cats as an integer on line

         $results[$key]->id                = (int) $results[$key]->id;

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8556>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list