WPIntell

Source evidence

Missing argument 2 for wpdb::prepare error

bbPress Post Ratings · support · 2013-08-23T07:56:00+00:00

complaintsentiment
highseverity
1.0relevance
14replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

5 / 34 rows with source links

14.7% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

29 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
Andy unresolved
I get this when I install on latest version of WordPress + BBPress + Buddypress: Warning: Missing argument 2 for wpdb::prepare(), called in /home/website/public_html/wp-content/plugins/bbpress-post-ratings/plugin.php on line 147 and defined in /home/website/public_html/v2/wp-includes/wp-db.php on line 992 http://wordpress.org/plugins/bbpress-post-ratings/ Everyone should be getting this error if they’ve upgraded. I just installed it. A quick search brought me to the site below… PHP Warning: Missing argument 2 for wpdb::prepare() Could someone reply with exactly how we should edit the plugin? I’m not savvy enough to do it myself :-S Quick and dirty fix : in wp-content/plugins/bbpress-post-ratings/plugin.php at line 147 change prepare to query. @mediart thanks for the reply but that means nothing to me! Could you let me know exactly how line 147 should read? (I don’t code btw, just tinker.) Andy – Jimaroonie, did either of you get a fix for this in the end?? Have the same problem and just want to know what line 147 should read. $authorIDs = $wpdb->get_col($wpdb->prepare(“SELECT post_author FROM ” . $wpdb->posts . ” WHERE ID = ” . intval($postID) . ” LIMIT 1″)); @deswardo nope! Still a desirable feature though… Rats I am now getting this error Missing argument 2 for wpdb::prepare(), called in /home/*******/public_html/forum/wp-content/plugins/bbpress-post-ratings/plugin.php on line 147 and defined in /home/******/public_html/forum/wp-includes/wp-db.php Any solution? I replaced “prepare” with “query” and suggested but everyone’s Forum posting votes goes to zero and the voting buttons don’t work now. But the error message is gone. No solution? This plugin is broken and needs fixing Had the same problem. Guess I’ll have to find another plugin, I think there is no support for this one. Warning: Missing argument 2 for wpdb::prepare(), called in C:\xampp\htdocs\wordpress\wp-content\plugins\bbpress-post-ratings\plugin.php on line 147 and defined in C:\xampp\htdocs\wordpress\wp-includes\wp-db.php on line 1147 Hi guys, I fixed it as follows: =================================================================== --- wp-content/plugins/bbpress-post-ratings/plugin.php (revision ) +++ wp-content/plugins/bbpress-post-ratings/plugin.php (revision ) @@ -144,7 +144,7 @@ function bbpress_post_ratings_GetPostAuthorID($postID){ global $wpdb; - $authorIDs = $wpdb->get_col($wpdb->prepare("SELECT post_author FROM " . $wpdb->posts . " WHERE ID = " . intval($postID) . " LIMIT 1")); + $authorIDs = $wpdb->get_col($wpdb->prepare("SELECT post_author FROM {$wpdb->posts} WHERE ID = %d LIMIT 1", $postID)); return $authorIDs[0]; } Tadas – thank you! That worked 😀 Hi there, I have buddypress and bbpress on my site and with this plugin I can rate the post on the forums bbpress but the karma don’t appear in the buddypress profuile. What an hell, anyone can help me? Thank you. Marco

Comments

14 shown
BottleInfrontomy 2013-09-17T00:49:00+00:00

Everyone should be getting this error if they’ve upgraded. I just installed it. A quick search brought me to the site below… PHP Warning: Missing argument 2 for wpdb::prepare()

jimaroonie 2014-01-22T02:37:00+00:00

Could someone reply with exactly how we should edit the plugin? I’m not savvy enough to do it myself :-S

Muhammad Tauseef 2014-01-25T23:09:00+00:00

Quick and dirty fix : in wp-content/plugins/bbpress-post-ratings/plugin.php at line 147 change prepare to query.

jimaroonie 2014-01-27T10:27:00+00:00

@mediart thanks for the reply but that means nothing to me! Could you let me know exactly how line 147 should read? (I don’t code btw, just tinker.)

deswardo 2014-03-04T15:37:00+00:00

Andy – Jimaroonie, did either of you get a fix for this in the end?? Have the same problem and just want to know what line 147 should read. $authorIDs = $wpdb->get_col($wpdb->prepare(“SELECT post_author FROM ” . $wpdb->posts . ” WHERE ID = ” . intval($postID) . ” LIMIT 1″));

jimaroonie 2014-03-04T20:19:00+00:00

@deswardo nope! Still a desirable feature though…

palmdoc 2014-04-27T05:02:00+00:00

Rats I am now getting this error Missing argument 2 for wpdb::prepare(), called in /home/*******/public_html/forum/wp-content/plugins/bbpress-post-ratings/plugin.php on line 147 and defined in /home/******/public_html/forum/wp-includes/wp-db.php Any solution?

palmdoc 2014-04-27T07:15:00+00:00

I replaced “prepare” with “query” and suggested but everyone’s Forum posting votes goes to zero and the voting buttons don’t work now. But the error message is gone.

palmdoc 2014-05-14T13:54:00+00:00

No solution? This plugin is broken and needs fixing

Topher Jamero 2014-06-30T02:28:00+00:00

Had the same problem. Guess I’ll have to find another plugin, I think there is no support for this one.

Topher Jamero 2014-06-30T02:30:00+00:00

Warning: Missing argument 2 for wpdb::prepare(), called in C:\xampp\htdocs\wordpress\wp-content\plugins\bbpress-post-ratings\plugin.php on line 147 and defined in C:\xampp\htdocs\wordpress\wp-includes\wp-db.php on line 1147

Tadas Krivickas 2014-07-08T16:16:00+00:00

Hi guys, I fixed it as follows: =================================================================== --- wp-content/plugins/bbpress-post-ratings/plugin.php (revision ) +++ wp-content/plugins/bbpress-post-ratings/plugin.php (revision ) @@ -144,7 +144,7 @@ function bbpress_post_ratings_GetPostAuthorID($postID){ global $wpdb; - $authorIDs = $wpdb->get_col($wpdb->prepare("SELECT post_author FROM " . $wpdb->posts . " WHERE ID = " . intval($postID) . " LIMIT 1")); + $authorIDs = $wpdb->get_col($wpdb->prepare("SELECT post_author FROM {$wpdb->posts} WHERE ID = %d LIMIT 1", $postID)); return $authorIDs[0]; }

palmdoc 2014-07-08T23:37:00+00:00

Tadas – thank you! That worked 😀

MarcoDiModena 2014-07-29T13:30:00+00:00

Hi there, I have buddypress and bbpress on my site and with this plugin I can rate the post on the forums bbpress but the karma don’t appear in the buddypress profuile. What an hell, anyone can help me? Thank you. Marco