Support » Fixing WordPress » SQL query bloken after updating to 2.1.3

  • Hello,

    I just updated from version 2.0.5 to 2.1.3. After doing that I realized that function get_links() no longer returned the links I was having. I used it like this:

    <?php get_links(1, '<li>', '</li>', '', FALSE, 'name', FALSE, FALSE, -1, FALSE); ?>

    where 1 is the id of a category called blogroll. (I have several, this is just an example). After debugging through the code, I realized that where was something wrong with the function get_bookmarks() which is called by get_links().

    At some point, there is this piece of code

    foreach ( $incategories as $incat ) {
    	if (empty($category_query))
    		$category_query = ' AND ( category_id = ' . intval($incat) . ' ';
    		$category_query .= ' OR category_id = ' . intval($incat) . ' ';

    The use of the field category_id doesn’t seem to be correct there. If I change it to link_category, which is the actual name of the field in my links table, everything works fine. Or at least I haven’t seen side effects yet.

    I have several questions: why did this happen? Is it a bug? I did not change anything in the database, only updated the software. Is it likely that my change would break other parts of the blog? Should I change the use of get_links() with something else?

    Thank you very much,
    Marius Bancila

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘SQL query bloken after updating to 2.1.3’ is closed to new replies.