Support » Plugin: Media Library Categories » SQL SELECT Error

  • 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.

Viewing 3 replies - 1 through 3 (of 3 total)

    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!

    Plugin Author merganser


    i will remove this for the next version.

    Plugin Author merganser


    commented out in 1.1.1

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘SQL SELECT Error’ is closed to new replies.