Automattic/Co-Authors-Plus — pull request #66 by vickybiswas (2012-10-19 00:16:35+00:00)
Title: Merging SHA-1: 0d96b084a72b9f392291585f7554f1efc5bf255c

* I came across this problem where I created 3 posts
1. Post with a native WP user
2. Post with same native user but I removed the native user and added a Guest Author Instead
3. Post with same native user as the two above and added a Guest Author.
The Issue...
When I saw the author page for the Guest Author I saw 2 and 3
When I saw the author page for The Wp native user I saw 1 2 and 3
While the former was as it is supposed to be the latter should have shown only 1 and 3 as the WP user was "not attached" to post

This solution treats a post to be of the user if
1. The User is in Guest Author List
2. The User is in WP User Field and no Guest Author is attached to post

Two things I think I can do to enhance the plugin further
1. I believe we can do away with the force_guest_author flag after this change
2. I believe instead of the 2 INNER JOINS on Line 550 and 551 if we use LEFT Joins it will be more logical and faster in terms of query execution speed