WordPress.org

Ready to get started?Download WordPress

Forums

Image uploading not working with 3.5 (6 posts)

  1. rulethenation
    Member
    Posted 1 year ago #

    When i try to upload images in the post i get the "try again later" error.

    when i go into media and upload them i get

    Warning: Missing argument 2 for wpdb::prepare(), called in /home/content/70/6550770/html/wp-content/themes/gonzo/includes/widget_areas.php on line 154 and defined in /home/content/70/6550770/html/wp-includes/wp-db.php on line 990

    Warning: Cannot modify header information - headers already sent by (output started at /home/content/70/6550770/html/wp-includes/wp-db.php:990) in /home/content/70/6550770/html/wp-admin/async-upload.php on line 32
    21190

    Line 151 is

    $widgetized_pages = $wpdb->get_col($wpdb->prepare("SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE meta_key = 'omc_page_sidebar'"));

  2. CellaScarpi
    Member
    Posted 1 year ago #

    Have you disabled all plugins and changed to the 2012 theme?

    To see if it works then?

  3. rulethenation
    Member
    Posted 1 year ago #

    its my theme.. so im assuming its line 151 thats the problem

  4. Looking at those errors it looks like a plugin issue.
    @CellaScarpi is right. Try deactivating all of your plugins and then if the error goes away, reactivate them one by one.

    The error " Missing argument 2 for wpdb::prepare()," is discussed in the 3.5 master list - http://wordpress.org/support/topic/troubleshooting-wordpress-35-master-list?replies=4

    Hopefully plugin developers will fix these errors soon.

  5. rulethenation
    Member
    Posted 1 year ago #

    i deactivated everything it was still there, when i changed my theme it worked

  6. rulethenation
    Member
    Posted 1 year ago #

    i found a solution at
    http://www.skyebook.net/blog/2012/12/wpdbprepare-warning-in-wordpress-3-5/

    this is an example he used

    <?php
    // Old (single argument) function call
    global $wpdb;
    $authorIDs = $wpdb->get_col($wpdb->prepare("SELECT post_author FROM " . $wpdb->posts . " WHERE ID = " . intval($postID) . " LIMIT 1");
    
    // New (two argument) function call
    global $wpdb;
    $authorIDs = $wpdb->get_col($wpdb->prepare("SELECT post_author FROM " . $wpdb->posts . " WHERE ID = " . intval($postID) . " LIMIT 1", array()));
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.