• After updating to WordPress 4.6, any WordPress queries that include both ‘category_name’ and ‘author_name’ results in the following error:

    WordPress database error: [Not unique table/alias: ‘wp_term_relationships’]
    SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) LEFT JOIN wp_term_taxonomy ON ( wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id ) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (1) ) AND ((wp_posts.post_author = 1 OR (wp_term_taxonomy.taxonomy = ‘author’ AND wp_term_taxonomy.term_id = ‘5’))) AND wp_posts.post_type = ‘post’ AND ((wp_posts.post_status = ‘publish’)) GROUP BY wp_posts.ID HAVING MAX( IF ( wp_term_taxonomy.taxonomy = ‘author’, IF ( wp_term_taxonomy.term_id = ‘5’,2,1 ),0 ) ) <> 1 ORDER BY wp_posts.post_date DESC LIMIT 0, 1

    To reproduce, add this to a clean WordPress 4.6 install running CoAuthors Plus: https://gist.github.com/billerickson/c2422064a108e777dd15fa44dfd60306

    First reported here: https://ww.wp.xz.cn/support/topic/any-problems-with-wp-46?replies=7

    https://ww.wp.xz.cn/plugins/co-authors-plus/

Viewing 8 replies - 1 through 8 (of 8 total)
  • I’m having a similar issue where none of the results are coming back for author_name.

    This page use to return results now I get nothing
    https://www.digimediapros.com/contributor/jon-belew/

    Thank you Bill!

    I look forward to a CoAuthors Plus update so that I can update to WP 4.6!

    Does anyone know if Co-Authors Plus has been tested with WP 4.6.1? I am having an issue with the wrong author showing up in posts. This is using the WP-Prosperity theme.

    I looks like they’re working on a fix in the GitHub repo for this plugin: https://github.com/Automattic/Co-Authors-Plus

    I updated co-authors-plus.php to the latest one from their GitHub repo, and it resolved the issue with no results coming up for author_name.

    Thanks @jamiebergen; this is good news. This bug has been annoying our blog editor for past couple of months.

    I the authors will update this plugin; the lastest version I see is 3.2.1 by By Mohammad Jangda, Daniel Bachhuber. I am not that familiar with updating php files in WordPress.

    –Rick

    Thank you @jamiebergen! I replaced the “old” php file with the one from GitHub and it works like a charm!

    Hope they update the plugin soon so that it’s official for everyone!

    I’m glad it worked for you, @kendawes, and I agree that they should release this bug fix. (I think they’re maybe trying to work out one other bug and then release both fixes at once…?) @rcx, if you have FTP access to your site, you can replace the existing copy of co-authors-plus.php (found at wp-content/plugins/co-authors-plus/co-authors-plus.php) with the one downloaded from here: https://github.com/Automattic/Co-Authors-Plus. Or wait for them to release an update, which will presumably have that fix.

    Unfortunately this code patch did not work for me. Multiple authors do not appear, and the Search box for authors in the the WP Dashboard does not work at all. I hope the plug-in authors will take note and correct this soon.

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

The topic ‘WP Query issue with WordPress 4.6’ is closed to new replies.