Support » Plugin: Post Types Order » WP 3.5 Warning Post Types Order Warning: Missing argument 2 for wpdb::prepare()

  • Resolved alfredo49

    (@alfredo49)


    Hi

    Im testing WP 3.5 RC1 and the plugin give me two warnings:
    Warning: Missing argument 2 for wpdb::prepare(), called in /usr/home/miweb.com/wp-content/plugins/post-types-order/post-types-order.php on line 195 and defined in /usr/home/miweb.com/wp-includes/wp-db.php on line 990

    Warning: Missing argument 2 for wpdb::prepare(), called in /usr/home/miweb.com/wp-content/plugins/post-types-order/post-types-order.php on line 272 and defined in /usr/home/miweb.com/wp-includes/wp-db.php on line 990

    http://wordpress.org/extend/plugins/post-types-order/

Viewing 15 replies - 1 through 15 (of 23 total)
  • I am getting this error with BuddyPress.

    I’m getting a similar error when using another post ordering plugin

    Warning: Missing argument 2 for wpdb::prepare(), called in /home/djgary/public_html/wp-content/plugins/q2w3-post-order/q2w3-post-order.php on line 1098 and defined in /home/djgary/public_html/wp-includes/wp-db.php on line 990

    WordPress 3.5RC1

    Same here. using BuddyPress 1.6:

    Warning: Missing argument 2 for wpdb::prepare(), called in /wp-content/plugins/buddypress/bp-core/bp-core-functions.php on line 176 and defined in /wp-includes/wp-db.php on line 990
    
    Warning: Missing argument 2 for wpdb::prepare(), called in /wp-content/plugins/buddypress/bp-core/bp-core-options.php on line 293 and defined in /wp-includes/wp-db.php on line 990
    
    Warning: Missing argument 2 for wpdb::prepare(), called in /wp-content/plugins/buddypress/bp-core/admin/bp-core-functions.php on line 220 and defined in /wp-includes/wp-db.php on line 990

    function prepare() has been redefined in WP 3.5 , now the function requires two arguments, before one was enough so the plugin author must modify the code to remove this warning

    It will not leave any plugin upgrade?

    Plugin Author nsp-code

    (@nsp-code)

    A new version will be released within next few days. Thanks.

    Same error here but with the paid plugin, advanced post types order. WordPress 3.5 was rolled out today please update ASAP!

    Julian

    (@sevensupreme)

    Same here with Category Icons Lite.

    Sorry, duplicated replies. Please delete this post.

    Hey guys! I had the same issue but using WP Post Thumbnail plugin. Since it is quite old (almost three years without updates), it was obvious that a WordPress update will result in some errors. Well, even being a old plugin, it is VERY useful for me, so I had to fix asap.

    I opened the archive and found the line that the error was. It was a query that was getting all the uploaded images on the post. The query was like this:

    function getPreset() {
    	global $wpdb;
    	return $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $this->wppt_preset_db" ) );
    }

    Since the WordPress update changed a few things of how $wpdb->prepare() works, all I need to do is add:

    $query = (string) $query;

    Before this query. The result will be like this:

    function getPreset() {
    	global $wpdb;
    	$query = (string) $query;
    	return $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $this->wppt_preset_db", $query ) );
    }

    Note that this solution is for WP Post Thumbnail plugin, but I posted the solution that worked for me here for maybe help someone with this same issue or something similar.

    Cheers!

    Q2W3 Post Order is now fixed for 3.5

    Thanks brunomonteiro3, I got the error on one of my themes and that fixed it.

    Plugin Author nsp-code

    (@nsp-code)

    Thanks brunomonteiro3 for sharing with us, however you are posting in the wrong place 🙂 I mean this board is for Post Types Order plugin.
    Also i confirm again this warning has been fixed an no longer appear on last WordPress release 3.5

    So maybe I too am in the wrong place but given that you are developer for the same company I will let you know that the paid plugin, advanced post types order, still does not work and no automated update has been released as far as I can see.

    Please help me..

    After updating wordpress to 3.5 I am getting this error.

    Warning: Missing argument 2 for wpdb::prepare(), called in /home/cpanel/public_html/wp-content/themes/clipper/includes/admin/admin-options.php on line 291 and defined in /home/cpanel/public_html/wp-includes/wp-db.php on line 990

    Warning: Missing argument 2 for wpdb::prepare(), called in /home/cpanel/public_html/wp-content/themes/clipper/includes/admin/admin-options.php on line 292 and defined in /home/cpanel/public_html/wp-includes/wp-db.php on line 990

    I am using, Akismet, Internal link builder, WP Security and WP Smush.it plugins. Is it related to any of these plugins?

    I dont think so that this error is caused by plugins.. as some admin-options files are there. please help

Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘WP 3.5 Warning Post Types Order Warning: Missing argument 2 for wpdb::prepare()’ is closed to new replies.