WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery
[resolved] Missing argument wpdb: in 3.5 Final (52 posts)

  1. tanthalos
    Member
    Posted 1 year ago #

    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/

  2. carmelosantana
    Member
    Posted 1 year ago #

    Error is due to $wpdb::prepare() requiring a second argument. The boards are currently filled with the same exact error.

  3. ranno
    Member
    Posted 1 year ago #

    Well, I managed to make the warning to go away with the functionality still working.

    I made a change to nextgen-gallery/lib/tags.php by adding 'null' as second argument, changing the line

    $term_ids = $wpdb->get_col( $wpdb->prepare("SELECT term_id FROM $wpdb->terms WHERE slug IN ($sluglist) ORDER BY term_id ASC "));

    to

    $term_ids = $wpdb->get_col( $wpdb->prepare("SELECT term_id FROM $wpdb->terms WHERE slug IN ($sluglist) ORDER BY term_id ASC ", null));

  4. leo nagila
    Member
    Posted 1 year ago #

    goood is working now , thank you

  5. auckand
    Member
    Posted 1 year 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

  6. cynmccrackan
    Member
    Posted 1 year ago #

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

    I simply installed the NextGen Gallery update from Photocrati today and now have this error at the top of my posts. I'm using the current wp 3.5.

    Could you please fix it? I'm not comfortable creating my own temporary fix.

    I've deactivated the plugin until there's a fix but you are welcome to look at my site anyway:
    http://popcultureplayground.com

    Thank you.

  7. cynmccrackan
    Member
    Posted 1 year ago #

    Because my blog has 5 years worth of NextGen Gallery posts, I followed Ranno's suggestion. It changed nothing. Thank you, Ranno, anyway.

  8. arrisje
    Member
    Posted 1 year ago #

    I got an error to. Is NExt GEn going to fix this?

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

  9. arrisje
    Member
    Posted 1 year ago #

    here is my site http://arrisje.com

  10. Snackmaster
    Member
    Posted 1 year ago #

    @Ranno - your fixed worked perfectly for me. Thanks!
    I disabled the plugin, updated the code, re-enabled and no errors.

    My experience - I upgrade three NextGEN Gallery sites to WP 3.5 with no issues. A fourth site displayed errors during WP upgrade due to the legacy 'p2pConverter' plugin. After disabling 'p2pConverter' I had the NextGEN error discussed here. This would indicate that I was either lucky three times or the NextGEN works with 3.5 but fails in some situations.

  11. LionLK
    Member
    Posted 1 year ago #

    Thanks Ranno...

  12. pleski
    Member
    Posted 1 year ago #

    Thanks @Ranno, it works fine for me.
    http://www.michalplesnik.sk

  13. altafali
    Member
    Posted 1 year ago #

    same problem is here http://wallpapers.asf-mobiles.com/wallpaper/92

    plz tell me how to solve this problem

  14. electrifried
    Member
    Posted 1 year ago #

    Thanks Ranno that worked :D Love the forums!!!!

  15. CoCha
    Member
    Posted 1 year ago #

    Thanks Ranno!
    It works :)

  16. fredMCCR
    Member
    Posted 1 year ago #

    Ranno, you saved my day !
    Many thanks !!!

  17. v8paul
    Member
    Posted 1 year ago #

    Hey, Ranno... you're a genius !
    Thanks from me too !!!

  18. Bill Karkavos
    Member
    Posted 1 year ago #

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

    Thank you Ranno, saved my day too!

  19. ranno
    Member
    Posted 1 year ago #

    * 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!' :)

  20. imagiro
    Member
    Posted 1 year ago #

    Yep, worked for me as well, thanks Ranno!

  21. photocrati
    Member
    Plugin Author

    Posted 1 year ago #

    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!

  22. smmcats
    Member
    Posted 1 year ago #

    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

  23. ranno
    Member
    Posted 1 year ago #

    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

  24. pleski
    Member
    Posted 1 year ago #

    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

  25. bevyoung2013
    Member
    Posted 1 year ago #

    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.

  26. photocrati
    Member
    Plugin Author

    Posted 1 year ago #

    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! :)

  27. javiroces
    Member
    Posted 1 year ago #

    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' :)

  28. esmi
    Forum Moderator
    Posted 1 year ago #

  29. arrisje
    Member
    Posted 1 year ago #

    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 ;)

  30. larryjames
    Member
    Posted 1 year ago #

    Thank you ranno, your fix works :-)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic