WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Missing argument wpdb: in 3.5 Final

[Resolved] Missing argument wpdb: in 3.5 Final

  • tanthalos
    Member

    @tanthalos

    Warning: Missing argument 2 for wpdb::prepare(), called in /home/termopak/domains/przemyslawdurczak.pl/public_html/wp-content/plugins/nextgen-gallery/lib/tags.php on line 319

    Hi, I ‘ve just upgraded to wp 3.5. I have Nextgen 1.9.8 installed and working, however after the upgrade I’ve got this type o error.
    I have no clue what to do, this matter should be already solved (I’ve seen exacly the same error fixed in WP 3.5 RC2), but it didn’t work for me. Do you have any clue what could be the problem?

    Site is: http://www.przemyslawdurczak.pl

    Thx in advance

    http://wordpress.org/extend/plugins/nextgen-gallery/

Viewing 15 replies - 16 through 30 (of 51 total)
  • Hey, Ranno… you’re a genius !
    Thanks from me too !!!

    Bill Karkavos
    Participant

    @bill-karkavos

    Ranno’s fix worked just fine with the wp-db.php on line 990 issue.

    Thank you Ranno, saved my day too!

    ranno
    Member

    @rannotheman

    * to all who after my comment (a temporary fix, 3rd comment) still keep posting that they have same Warning problem and are desperately asking for a solution — I have no affiliation with NextGen, but I do believe they will shortly fix it with an update.

    * to all who found my comment helpful — as I am no code-wizard and as it is the very first time I have been able to contribute with a code fix, I am childishly cheering over every ‘thanks!’ 🙂

    Yep, worked for me as well, thanks Ranno!

    Plugin Author photocrati
    Participant

    @photocrati

    We are currently looking into this error. Could everyone who is experiencing this error provide the following [below]? We’re having difficulty replicating the same error, as our current test sites with WP 3.5 and NGG v1.9.8 are not showing any errors. We would like to provide a fix for all of you in our next upgrade, if possible. A big thanks to @ranno for providing that temp. fix! 🙂

    WordPress up to date?
    NextGEN up to date?

    (please confirm the following, with your server host tech) :
    MySQL up to date (5.2.4)?
    PHP up to date (5.0)?
    The mod_rewrite Apache module activated?
    PHP Safe Mode OFF?

    and if you’re willing to share:
    Who are you hosted with?
    What theme are you running?
    Which plugins do you have installed and activated?
    Does this error still occur if you switch your theme to the WP default, and deactivate all plugins except NextGEN Gallery? (*be sure to clear your browser cache and reload your site after deactivating)

    *Please also include the steps you took to see the error? i.e. adding a gallery/singlepic, managing gallery, or displays on frontend… Thanks!

    WordPress is 3.5
    nextgen is up to date
    everything else is correct
    I can’t add new galleries or images, that page doesn’t display
    I can’t delete the plugin, I get the same error displayed here.
    Everything worked until the wordpress upgrade

    ranno
    Member

    @rannotheman

    WP 3.5
    NGG 1.9.8
    MySQL 5.1.63-cll
    PHP 5.3.18
    mod_rewrite ON
    PHP Safe Mode OFF

    Hosted with virtuaal.com
    Warning displayed on both, personal customized theme and Twenty Twelve v 1.1.1
    Warning also occurs while NextGen Gallery is the only active plugin, so not including the list of the rest of the plugins.

    In my case the error occurs in following case:
    I add shortcode [nggtags album=2010] to a page. Published page (e.g. /nextgen-test/) displays link to the album, no error, but when clicking on the link, on the following page (e.g. /nextgen-test/?gallerytag=2010) the following warning is displayed before the gallery thumbnails:

    Warning: Missing argument 2 for wpdb::prepare(), called in (path)/wp-content/plugins/nextgen-gallery/lib/tags.php on line 318 and defined in (path)/wp-includes/wp-db.php on line 990

    WP 3.5
    nextgen 1.9.8 + foobox lightbox
    other modules: akismet, all in one seo pack, google xml sitemap, jetpack, wp-polls, wp database backup – all up to date, all working
    theme : striking

    Server settings
    OS : Linux (64 Bit)
    Server : Apache
    Memory : 64.31 MB
    MYSQL : 5.1.66-0+squeeze1
    mdd SQL : not set
    PHP : 5.3.19-1~dotdeb.0
    PHP Safe Mode : off
    PHP Allow URL fopen : on
    PHP Memory Limit : 500
    PHP Max Upload Size : 32M
    PHP Max Post Size : 33M
    PCRE Backtracking Limit : 500000
    PHP Max Script Execute Time : 120s
    PHP Exif : yes ( V1.4 )
    PHP IPTC : yes
    PHP XML : yes

    after @ranno fix everything works normally
    add a gallery, viewing pictures is working as usual

    bevyoung2013
    Member

    @bevyoung2013

    I fixed it by changing this code:

    function prepare( $query, $args ) {
    if ( is_null( $query ) )
    return;

    to this code:
    function prepare( $query = null ) { // ( $query, *$args )
    if ( is_null( $query ) )
    return;

    in wp-includes/wp-db.php

    Not saying it will work for everyone, but it did for me. I’m using the Advocate theme.

    Plugin Author photocrati
    Participant

    @photocrati

    Hey everyone,

    Looking further into this, it appears that this error you’re seeing is a new warning in WordPress v3.5 [see here] The reason not everyone is seeing this error, is that most WP friendly hosts have PHP display errors turned off by default. Just want to update you all that we are aware of this bug, and the need to provide a fix soon. We are planning on including a fix for this in the next upgrade. Until then, @ranno has provided the temp. solution [here] that should prevent that warning from showing up.

    *Please continue to provide the needed troubleshooting info as listed [here], so we can ensure we fix everything up in this bug for everyone. Many thanks! 🙂

    javiroces
    Member

    @javiroces

    WordPress up to date? 3.5
    NextGEN up to date? 1.9.8

    (MySQL up to date (5.2.4)? 5.1.65 cll
    PHP up to date (5.0)? 5.3.15
    The mod_rewrite Apache module activated? not sure…. :/
    PHP Safe Mode OFF? OFF

    and if you’re willing to share:
    Who are you hosted with? http://www.hostinet.com/
    What theme are you running? Prestige Dark
    Which plugins do you have installed and activated? lots, but with just NGG activated, error is here.
    Does this error still occur if you switch your theme to the WP default, and deactivate all plugins except NextGEN Gallery? (*be sure to clear your browser cache and reload your site after deactivating) YES, the error is still there, with just NGG activated, and WP default.

    Hope it works. Adding the “null” arg. error is ‘gone’ 🙂

    esmi
    Forum Moderator

    @esmi

    MySQL – 5.0.96
    PHP – 5.2.17
    Mod_rewrite is enabled
    Safe mode off in PHP
    Theme Magnificent
    Which plugins do you have installed and activated? lots, but with just NGG activated, error is still there
    YES, the error is still there, with just NGG activated, and WP default.

    And Rano Thank you it worked 😉

    larryjames
    Participant

    @larryjames

    Thank you ranno, your fix works 🙂

    Cheers Ranno. working well on simple catch theme

Viewing 15 replies - 16 through 30 (of 51 total)
  • The topic ‘[Resolved] Missing argument wpdb: in 3.5 Final’ is closed to new replies.