Closed benlk closed 10 months ago
Well, we were able to replicate it on Flywheel's server, and on a Laravel Valet test environment in WordPress 4.9.2. Enabling CAP causes non-guest-authors who have authored posts to show different post counts, and there's the issue with the inability to set coauthors.
Looking through the support forums, I think https://wordpress.org/support/topic/uninstalled-and-reinstalled-and-now-broken/ and https://wordpress.org/support/topic/authors-help/ are experiencing this same issue.
The issue mentioned in the comment posted on Dec 21, 2017 cannot be reproduced. Could you please provide screenshots of the steps to reproduce it?
Also, could you please provide more details with the screenshots for the issues mentioned in the last comment regarding different post counts and inability to set coauthors?
Here's a minimal test case. A WordPress user hstockton
has created a post, and the linked guest author halle-stockton
appears in the co-author bylines box in the post editor. We wish to add the guest author author-saima-sitwat
:
The prediction makes a request to admin-ajax, the complete response of which is:
6471 | author/saima-sitwat | Saima Sitwat | | author-saima-sitwat
Press save, here's the submitted form data:
The following appears in my server's ngnix error log when saving:
2018/02/05 15:29:01 [error] 86055#0: *2852 FastCGI sent in stderr: "PHP message: PHP Notice: Trying to get property of non-object in /Users/blk/sites/publicsource/wp-content/plugins/co-authors-plus/co-authors-plus.php on line 834 PHP message: PHP Notice: Trying to get property of non-object in /Users/blk/sites/publicsource/wp-content/plugins/co-authors-plus/co-authors-plus.php on line 844 PHP message: PHP Notice: Undefined offset: 0 in /Users/blk/sites/publicsource/wp-includes/capabilities.php on line 127" while reading response header from upstream, client: 127.0.0.1, server: publicsource.test, request: "POST /wp-admin/post.php HTTP/2.0", upstream: "fastcgi://unix:/Users/blk/.valet/valet.sock:", host: "www.publicsource.test", referrer: "https://www.publicsource.test/wp-admin/post.php?post=122238&action=edit"
After the post saves, the user Saima Sitwat is not in the co-authors box:
The inability to save author-saima-sitwat
occurs whether or not we remove the existing halle-stockton
byline. Removing the original author, which was mentioned in the first report, is not essential to reproduce.
If the role of the user who created the post matters, we can talk about that via email ben@inn.org. The WordPress user I'm using to perform this edit is an administrator that is not any of the users mentioned in the post meta.
Enabling CAP causes non-guest-authors who have authored posts to show different post counts, and there's the issue with the inability to set coauthors.
With CAP enabled, nkhan
has 248 posts listed at /wp-admin/users.php
. With CAP disabled, nkhan
has 385 posts - is this because the posts created by nkhan
but filed under a different byline are being excluded from nkhan
's post count in the users table? If it is, that's not a problem.
I've noticed that I get the same error message, but in a different situation. I'm not sure how similar it is, but it seems relevant. To be clear, here's my error log:
Notice: Trying to get property of non-object in /minnpost-wordpress/wp-content/plugins/co-authors-plus/co-authors-plus.php on line 834
Notice: Trying to get property of non-object in /minnpost-wordpress/wp-content/plugins/co-authors-plus/co-authors-plus.php on line 844
My situation is when I'm logged in as a user with a role of "author" or lower. That is, not an "editor" or "administrator". I see this error on /wp-admin/post-new.php, and the box for selecting myself as an author is missing.
I'm unable to reproduce the issue in the original comment (from Dec 21; detailed in the comment from Feb 5) using both full-user authors and guest authors under WP v4.9.4 under a VCCW vagrant box as an administrator. I did however notice an issue similar to @jonathanstegall when attempting to view a guest-author's page when logged in as an administrator:
Trying to get property of non-object in /var/www/html/wp-content/plugins/Co-Authors-Plus/co-authors-plus.php on line 728
Trying to get property of non-object in /var/www/html/wp-content/plugins/Co-Authors-Plus/co-authors-plus.php on line 729
I've separated comment regarding incorrect post counts to a separate issue: #494
I've tried reproducing the issue, but did not manage to. From the behavior you are getting, it almost looks like you don't have permissions to set coauthors. I know you have said you used an admin account @benlk, but at this point it may be worth checking that $this->current_user_can_set_authors( $post )
returns true
for you!
I'm going to close out this old issue, but if it can be recreated with the latest release, then it can be re-opened.
Steps to reproduce:
In 4.9.0, the above steps resulted in the second co-author being the sole co-author on the post. In 4.9.1., the second co-author is nowhere to be found and the first co-author remains on the post.
This was discovered in WP Engine's production and staging environments; I will attempt to replicate in different environments and update this ticket.