WordPress.org

Ready to get started?Download WordPress

Forums

Post Types Order
[resolved] WP 3.5 Warning Post Types Order Warning: Missing argument 2 for wpdb::prepare() (24 posts)

  1. alfredo49
    Member
    Posted 1 year ago #

    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/

  2. OperaManiac
    Member
    Posted 1 year ago #

    I am getting this error with BuddyPress.

  3. monkeypigs
    Member
    Posted 1 year ago #

    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

  4. JeffreyLin
    Member
    Posted 1 year ago #

    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
  5. alfredo49
    Member
    Posted 1 year ago #

    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

  6. alfredo49
    Member
    Posted 1 year ago #

    It will not leave any plugin upgrade?

  7. nsp-code
    Member
    Plugin Author

    Posted 1 year ago #

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

  8. Chris
    Member
    Posted 1 year ago #

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

  9. Julian
    Member
    Posted 1 year ago #

    Same here with Category Icons Lite.

  10. brunomonteiro3
    Member
    Posted 1 year ago #

    Sorry, duplicated replies. Please delete this post.

  11. brunomonteiro3
    Member
    Posted 1 year ago #

    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!

  12. monkeypigs
    Member
    Posted 1 year ago #

    Q2W3 Post Order is now fixed for 3.5

  13. nskraus
    Member
    Posted 1 year ago #

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

  14. nsp-code
    Member
    Plugin Author

    Posted 1 year ago #

    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

  15. Chris
    Member
    Posted 1 year ago #

    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.

  16. sashamenis
    Member
    Posted 1 year ago #

    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

  17. nsp-code
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Chris, please use the personal link you got when bought the plugin to fetch the latest version which currently is 2.5.3.9. You may use an older data (2.4 or so) which does not include update acknowledge.
    If you still have issue, please contact us directly and someone will check into this for your right away. Thanks

  18. nsp-code
    Member
    Plugin Author

    Posted 1 year ago #

    sashamenis Please contact the author of those plugins/theme as this is not caused by the Post Types Order

  19. graphical_force
    Member
    Posted 1 year ago #

    rcents, is this something that would be fixed in the next update to WordPress which should be 3.51?

  20. esmi
    Forum Moderator
    Posted 1 year ago #

    No. It's up to theme and plugin developers to update their products.

  21. sashamenis
    Member
    Posted 1 year ago #

    Hello Mates..

    I just resolved my problem. If anyone is having same problem please check this thread.

    http://wordpress.org/support/topic/missing-argument-2-for-wpdbprepare-3?replies=27

  22. beginnersluck
    Member
    Posted 1 year ago #

    rcents. Thank-you! :) Genius!

  23. nataca
    Member
    Posted 12 months ago #

    Thank you very much brunomonteiro3.
    I had the same error in WP Post Thumbnail when upgrading to WordPress 3.6.

  24. Marj Wyatt
    Member
    Posted 11 months ago #

    Thanks @brunomonteiro3

    Your solution worked for another plugin (category_icons) and I'm sure you saved me a half hour of hair-tearing frustration. :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic