Folding Category List (FoCaL)
How to fix the error: "Missing argument 2 for wpdb::prepare()" (7 posts)

  1. Neoras
    Posted 2 years ago #

    Since WP 3.5 there is an error when saving posts when Focal is enabled (line 980 in focal_wp28.php). To fix this, replace the line

    $querystr = $wpdb->prepare($querystr);


    $querystr = $wpdb->prepare($querystr,null);

    That solved the issue for me. Thanks to http://wordpress.org/support/topic/missing-argument-2-for-wpdbprepare?replies=2, it seems that other plugins are affected, too


  2. auckand
    Posted 2 years ago #

    I have the same error using the Sharebar plugin. Until the developers update their plugins try this in your function.php

    ini_set( 'display_errors', false );
    error_reporting( 0 );

    It stops error mesages and once the plugin devs update- just remove the code.

    Worked over at http://www.outdoorphotography.co.nz/ I hope this helps

  3. befound
    Posted 2 years ago #

    @auckand thank you, your solution worked from me. Editing the plugin did not work.

    Really appreciate both of you for posting here!

  4. makibird
    Posted 2 years ago #

    Thanks! Unfortunately the first solution didn't work for me, although it had done in a previous version, so I had to hide the error reporting.
    Unfortunately, my FoCaL isn't functioning properly now :(

  5. smiro2000
    Posted 2 years ago #

    change line 928 from

    $query = $wpdb->prepare($query,);


    $query = $wpdb->prepare($query, null);

    as well as what's suggested by @Neoras in comment #1

    hopefully we can see those changes in the next update.

    Thank you!

  6. Tim Trott
    Plugin Author

    Posted 2 years ago #

    Sorry for the delay fixing this, been away over Christmas taking some personal time.

    Just uploaded a new version to the repository which addresses this issue as per smiro2000's suggestion.


  7. befound
    Posted 2 years ago #

    azuliadesigns, Thank you!!! And thank you for one of my favorite plugins.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Folding Category List (FoCaL)
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.