[buddypress-trac] [BuddyPress] #4716: BP Group Reviews Plugin Error After Upgrading Wordpress to 3.5

buddypress-trac noreply at wordpress.org
Wed Dec 12 00:59:12 UTC 2012


#4716: BP Group Reviews Plugin Error After Upgrading Wordpress to 3.5
--------------------------+-----------------------------
 Reporter:  ozgurpolat    |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Core          |    Version:
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 Plugin: BP Group Reviews 1.3.1
 Wordpress 3.5

 I get the following error after upgrading to wordpress 3.5:

 "Warning: Missing argument 2 for wpdb::prepare(), called in
 /home/kooksj5/public_html/kooksjournal.com/wp-content/plugins/bp-group-
 reviews/bp-group-reviews.php on line 203 and defined in"

 I fixed the problem by changing the bp-group-reviews.php.

 1. First change:
 Was:

 $wpdb->prepare( "SELECT activity_id, meta_value AS rating FROM
 {$bp->activity->table_name_meta} WHERE activity_id IN ({$activity_ids})
 AND meta_key = 'bpgr_rating'" ) );

 Is:

 "SELECT activity_id, meta_value AS rating FROM
 {$bp->activity->table_name_meta} WHERE activity_id IN ({$activity_ids})
 AND meta_key = 'bpgr_rating'" );


 2. Second change:

 was: $wpdb->prepare( "
                         SELECT m1.group_id, m1.meta_value AS rating,
 m2.meta_value AS rating_count, m3.meta_value AS ratings_enabled
                         FROM {$bp->groups->table_name_groupmeta} m1
                         LEFT JOIN {$bp->groups->table_name_groupmeta} m2
 ON (m1.group_id = m2.group_id)
                         LEFT JOIN {$bp->groups->table_name_groupmeta} m3
 ON (m1.group_id = m3.group_id)
                         WHERE m1.group_id IN ({$group_ids})
                         AND m1.meta_key = 'bpgr_rating'
                         AND m2.meta_key = 'bpgr_how_many_ratings'
                         AND m3.meta_key = 'bpgr_is_reviewable'"
                 ) );

 is:

 "
                         SELECT m1.group_id, m1.meta_value AS rating,
 m2.meta_value AS rating_count, m3.meta_value AS ratings_enabled
                         FROM {$bp->groups->table_name_groupmeta} m1
                         LEFT JOIN {$bp->groups->table_name_groupmeta} m2
 ON (m1.group_id = m2.group_id)
                         LEFT JOIN {$bp->groups->table_name_groupmeta} m3
 ON (m1.group_id = m3.group_id)
                         WHERE m1.group_id IN ({$group_ids})
                         AND m1.meta_key = 'bpgr_rating'
                         AND m2.meta_key = 'bpgr_how_many_ratings'
                         AND m3.meta_key = 'bpgr_is_reviewable'"
                 ) ;

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


More information about the buddypress-trac mailing list