WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [closed] How to fix NeoEase Inove theme "Missing Argument 2" issue? (10 posts)

  1. MacHawk
    Member
    Posted 1 year ago #

    This theme worked without issue prior to 3.5.

    Complete PHP error at bottom of the screen:

    Warning: Missing argument 2 for wpdb::prepare(), called in /home/directma/public_html/jonathanblaine.com/wpress/wp-content/themes/inove/footer.php on line 22 and defined in /home/directma/public_html/jonathanblaine.com/wpress/wp-includes/wp-db.php on line 990

    Great theme that I want to continue using.

  2. MacHawk
    Member
    Posted 1 year ago #

    Yes, I've seen that. That advice is for developers. I simply want to stop display of the PHP error until (or if) the author fixes it. I am not a WP guru, but could likely patch it if I knew where in the wp-config.php to insert that line of code: @ini_set('display_errors', 0);

    Apparently, hundreds of thousands of sites were affected (and not in a good way) by 3.5 in various ways.

  3. Read the link I posted; simply turn off error reporting. Read Editing wp-config.php « WordPress Codex

    Apparently, hundreds of thousands of sites were affected (and not in a good way) by 3.5 in various ways.

    3.5 was in beta for months; theme and plugin developers has lots of time to get ready.

  4. MacHawk
    Member
    Posted 1 year ago #

    I figured out how to fix it: revert to 3.4.2. All is well with the world again. When it's WIDELY reported that WP finally has things working again, I'll upgrade.

    One of these days, all the tech heads will figure out the vast majority WP sites are NOT run by fellow tech heads. OK, well, maybe that won't happen. But WE just want stuff to work. We have other stuff to worry about.

    I'll mark this resolved, even if it isn't.

  5. @machawk said:

    When it's WIDELY reported that WP finally has things working again, I'll upgrade.

    Realize that WP is free software, used by ~40-50 million, maintained by many, many people, and these forums are staffed by volunteers. The theme you are using is a third party theme that has no connection with WP itself; it if breaks, it's not WP's problem; it's who you got the theme from.

    One of these days, all the tech heads will figure out the vast majority WP sites are NOT run by fellow tech heads.

    And that's why you're here: getting free help.

    But WE just want stuff to work. We have other stuff to worry about

    Then write your own code.

  6. Samuel Wood (Otto)
    Tech Ninja
    Posted 1 year ago #

    I am not a WP guru, but could likely patch it if I knew where in the wp-config.php to insert that line of code: @ini_set('display_errors', 0);

    Second line, right after the opening <?php.

    Or, ideally, set the display_errors setting to zero/false/off in the php.ini file, or however your host says to do it. You should never have display_errors enabled on a live production site.

  7. MacHawk
    Member
    Posted 1 year ago #

    Thanks Samuel for spelling it out. Handing someone bunch of stuff as if to say "here, you figure it out" as was done earlier never gets anything done very quickly or well.

    After some deep Googling, I found a Dutch site that addressed the Inove issue by adding 6 characters to the footer.php code.

    I will still stay at 3.4.2 due to other reported major issues with 3.5, however, and there are no real security issues presented by not upgrading at this stage.

    In the event others are seeking this out for Inove, here is the fix. Chrome will translate the page in question, but use the non-translated page for the code:

    http://www.web-pepper.com/nieuws/wordpress-3-5-inove-template-fix/

    Find the line:
    $post_datetimes = $wpdb->get_row($wpdb->prepare(“SELECT YEAR(min(post_date_gmt)) AS firstyear, YEAR(max(post_date_gmt)) AS lastyear FROM $wpdb->posts WHERE post_date_gmt > 1970″));

    Replace with:
    $post_datetimes = $wpdb->get_row($wpdb->prepare(“SELECT YEAR(min(post_date_gmt)) AS firstyear, YEAR(max(post_date_gmt)) AS lastyear FROM $wpdb->posts WHERE post_date_gmt > 1970″, null));

    Actually, pasting in , null after 1970″ is all that is needed.

  8. Samuel Wood (Otto)
    Tech Ninja
    Posted 1 year ago #

    A more correct fix to that would be to remove the prepare() command entirely, as it's not being used properly in this case.

    $post_datetimes = $wpdb->get_row("SELECT YEAR(min(post_date_gmt)) AS firstyear, YEAR(max(post_date_gmt)) AS lastyear FROM $wpdb->posts WHERE post_date_gmt > 1970");

  9. jdwel
    Member
    Posted 1 year ago #

    thanks Samuel Wood the fix that MacHawk posted didnt work with me but yours worked just fine

Topic Closed

This topic has been closed to new replies.

About this Topic