WordPress.org

Ready to get started?Download WordPress

Forums

Media Library Categories
SQL SELECT Error (4 posts)

  1. joejozwowski
    Member
    Posted 2 years ago #

    If there is no media in a category, and you call said category on a page, you get the following error:

    Error!SELECT p.*, a.term_order FROM wp_posts p inner join wp_term_relationships a on a.object_id = p.ID inner join wp_term_taxonomy ttt on ttt.term_taxonomy_id = a.term_taxonomy_id inner join wp_terms tt on ttt.term_id = tt.term_id where ttt.taxonomy='media_category' && tt.term_id=15 order by a.term_order asc

    15 is the media category ID

    Shouldn't it just not display anything? How can I modify the shortcodes.php to resolve this issue. I am using v1.0.8 of this plugin.

  2. joejozwowski
    Member
    Posted 2 years ago #

    A TEMPORARY FIX

    If you look in the shortcodes.php file, you should see the following on line 63

    echo "Error!".$wpdb->print_error().$query;

    change this to:

    echo "";

    No More Error message.

    I do like the fact that the code will alert you if there is nothing in the query, but COME ON... that wpdb print error message is extremely verbose!

  3. merganser
    Member
    Plugin Author

    Posted 2 years ago #

    i will remove this for the next version.
    thanks!

  4. merganser
    Member
    Plugin Author

    Posted 2 years ago #

    commented out in 1.1.1

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic