WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. ibm450
    Member
    Posted 1 year ago #

    Cheers Ranno. working well on simple catch theme

  2. vanetreg
    Member
    Posted 1 year ago #

    I made Ranno's modification ( adding a 'null' argument) but I still have the error.
    More precisely: when I display ALL items then I don't get error message, but when I filter to eg. FEATURED items or want to display any FILTERED list then I've got the error!

  3. SimonFinch
    Member
    Posted 1 year ago #

    Ranno Rocks !

  4. guylenelefort@bell.net
    Member
    Posted 1 year ago #

    Merci Ranno ! It works with PageLines Framework theme. It was NextGen that referred me to your post. Thanks again !

  5. wost
    Member
    Posted 1 year ago #

    Ranno, you are the man! Thank you so much!!! Your fix worked perfect, I was going to lose it, but thanks to you my little site is up and running again. All the best!

  6. shammah
    Member
    Posted 1 year ago #

    Thanks Ranno~~for the temporary fix; worked and got rid of the code showing up on my frontpage! Now, hopefully they'll update the plugin!

    Namaste

    Velma

  7. cynmccrackan
    Member
    Posted 1 year ago #

    I'm back to thank Ranno.
    I tried your suggeston again and it worked!

    I have Mindstream theme. I did turn off all the plugins--the error was still there. I have the current WordPress update.

    One thing I got complacent about was updating too quickly. Never will I do that again. I used to wait a week to see if this type issue happened. Only when it was resolved did I update. I was too quick on the trigger this time. Live and learn--and be grateful for kind people like Ranno!

  8. nunopicado
    Member
    Posted 1 year ago #

    ranno's fix is a temp like he said, but anyone who want can't make the permanent fix (the one this error code is intended to trigger):

    Just go to tags.php, on line 318, and replace this:

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

    with this:

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

    The idea behind it is to force the correct use of $wpdb->prepare. To prepare a query, you always need at least two arguments, and no variable should go in the first.

  9. Trashfunkel
    Member
    Posted 1 year ago #

    THANK YOU !!! YOU MAKE IT !!!!!!

  10. FlipFl0p
    Member
    Posted 1 year ago #

    Fantastic, worked thank you!

  11. secretgardens
    Member
    Posted 1 year ago #

    Thanks Ranno it worked. I really needed it to work, i want to let you know i am extremely grateful

  12. drmcatcher
    Member
    Posted 1 year ago #

    I changed line 990 to this in wp-db.php:

    /*
    Set args = null in function below to avoid future problems with other plugins. I assume WordPress will do something similar in a future update, but this works for now.
    */
    // OLD FUNCTION
    // function prepare( $query, $args ) {
    // NEW FUNCTION
    function prepare( $query = null, $args = null ) {
  13. nunopicado
    Member
    Posted 1 year ago #

    @drmcatcher
    Maybe it's not so good idea to mess with wp-db.php file.

    After all, it was NextGen the cause of the problem, not WordPress itself.

    By doing that you are ignoring potencial plugin bugs that may allow SQL Injections on your site.
    This means that your entire database may eventually be deleted by some less-than-honest-but-IT-aware user.

    Maybe you should stick with correcting the bug in NextGen, instead of creating one in WordPress... ;)

  14. larryjames
    Member
    Posted 1 year ago #

    @drmcatcher - nunopicado is right!

    There is a solution here posted by Ranno. It is a temporary solution, and the changes made will be over written when NextGen updates the plugin. There is no need to make changes to the core files of WordPress.

  15. nunopicado
    Member
    Posted 1 year ago #

    There is also a permanent solution (the correction Photocrati will probably make to NextGen) a few posts above, that I stated.

    It's just about using wpdb->prepare the way it's supposed to, and all will be fine.

  16. jjfavors
    Member
    Posted 1 year ago #

    thank you ranno, totally fixed me up!

  17. pleski
    Member
    Posted 1 year ago #

    Five days ago I made ​​the correction of the file “tags.php” according to Ranno’s advice – by adding a second parameter to NULL. Error message disappeared, everything seemed to be fine. But yesterday my hosting administrator has deactivated my website with the justification, that some running processes exhibit an overlimit usage of the server system resources. When disabled, the gallery was shutdown and remained non-functioning. This has most likely have something to do with the correction because my blog was running with no problems untill then.

  18. cafargo
    Member
    Posted 1 year ago #

    Same here Ranno. Your , null entry fixed it for me too. Mega thanks!!!

  19. ranno
    Member
    Posted 1 year ago #

    Sorry, @pleski, not sure how to help with that. I have applied the fix on two NGG installations on my shared server account and the resource usage details (CPU usage, Virtual Memory usage, entry processes) don't seem to indicate any problems, all are way under the max limits.

  20. nunopicado
    Member
    Posted 1 year ago #

    I also don't think it's likely that Ranno's solution is the source of that. It's probably a coincidence, I think.

  21. pleski
    Member
    Posted 1 year ago #

    @ranno there is another incompatibility, this time with a jetpack plugin, I have to wait to update. nextgen 1.9.9 is ok now

  22. redwebtoo
    Member
    Posted 1 year ago #

    Cheers, Ranno :-)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic