Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin user not listed in Author dropdown list (3 users in total) #12431

Closed
vedranmiletic opened this issue Nov 29, 2018 · 8 comments
Closed

Admin user not listed in Author dropdown list (3 users in total) #12431

vedranmiletic opened this issue Nov 29, 2018 · 8 comments
Labels
[Feature] Document Settings Document settings experience [Type] Help Request Help with setup, implementation, or "How do I?" questions.

Comments

@vedranmiletic
Copy link

Describe the bug
User with ID 1 is not shown in the dopdown list of the Authors when authoring a post, while users with IDs 2 and 3 are shown. Not a duplicate of #4622.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new post or edit an existing one.
  2. Click on the dropdown next to Author.
  3. Observe that only two users are listed.

Expected behavior
All users should be listed.

Screenshots
I can provide anonymized screenshots and dumps of the database if that would be useful.

Desktop (please complete the following information):

  • OS: Linux
  • Browser Firefox
  • Version 63

Additional context

  • Gutenberg 4.5.1.
  • Fairly old Wordpress installation upgraded regularly since 3.x.
  • User ID 1 used to have the login name admin which was changed via database by updating user_login field in the wp_users table, which caused no issues thus far.
@designsimply designsimply added the Needs Testing Needs further testing to be confirmed. label Nov 29, 2018
@designsimply
Copy link
Member

I tested with WordPress 4.9.8 and Gutenberg 4.5.1 using Firefox 63.0.3 on macOS 10.13.6 by adding a few new users to a basic test site, one with the Author role and one with the Editor role, and I found that I can see all three in the Authors dropdown in the editor document settings sidebar when logged in with either the Administrator user or the Editor user.

screen shot 2018-11-29 at 9 18 42 am

Note: I did not manually rename the admin user in the database, however, the default admin user for my site was set to demo (not admin) from the start.

May I ask if your site is a standalone or multisite install?

Does this problem happen on your site regardless of whether you are logged in as the Administrator or Editor role?

Do you have any plugins installed that manage user roles in any way?

@designsimply designsimply added [Status] Needs More Info Follow-up required in order to be actionable. and removed Needs Testing Needs further testing to be confirmed. labels Nov 29, 2018
@vedranmiletic
Copy link
Author

I tested with WordPress 4.9.8 and Gutenberg 4.5.1 using Firefox 63.0.3 on macOS 10.13.6 by adding a few new users to a basic test site, one with the Author role and one with the Editor role, and I found that I can see all three in the Authors dropdown in the editor document settings sidebar when logged in with either the Administrator user or the Editor user.

I presumed that. I have another installation that works fine.

Note: I did not manually rename the admin user in the database, however, the default admin user for my site was set to demo (not admin) from the start.

May I ask if your site is a standalone or multisite install?

Standalone.

Does this problem happen on your site regardless of whether you are logged in as the Administrator or Editor role?

Yes, I just checked with an editor account. The admin is still not shown.

Do you have any plugins installed that manage user roles in any way?

No.

@designsimply
Copy link
Member

Okay. I tested with a standalone install as well.

I know you mentioned this is not a duplicate of #4622. Is that because you have less than 100 users total for your site? How many users does your site have total?

If you add /wp-json/wp/v2/users to the end of your domain while logged in as an admin, you should be able to see a list of all users (paginated) which have published content associated with them. Can you check whether user with ID=1 has published content and if that users shows up when you go to yourdomain.com/wp-json/wp/v2/users?

@vedranmiletic
Copy link
Author

I know you mentioned this is not a duplicate of #4622. Is that because you have less than 100 users total for your site? How many users does your site have total?

If you add /wp-json/wp/v2/users to the end of your domain while logged in as an admin, you should be able to see a list of all users (paginated) which have published content associated with them. Can you check whether user with ID=1 has published content and if that users shows up when you go to yourdomain.com/wp-json/wp/v2/users?

Interestingly enough, I see two users, ID 1 and 2 (I see 2 and 3 in Gutenberg). Is it possible that I have a broken user count somewhere in the database?

@designsimply designsimply added [Type] Help Request Help with setup, implementation, or "How do I?" questions. and removed [Status] Needs More Info Follow-up required in order to be actionable. labels Dec 14, 2018
@designsimply
Copy link
Member

3 doesn't seem like too many!

If you haven't already, if you have updated to WP 5.0.1 already could you check to see if the problem goes away when you deactivate the Gutenberg plugin? If you have already updated to WP 5.0.1, the plugin should have been deactivated automatically and I would still be interested to know if the problem persists.

Since there haven't been any other similar reports of this that I can find in a quick search and because this issue is possibly caused by a database issue as you've mentioned, would you mind asking for help about it in the WordPress.org support forums at https://wordpress.org/support/forum/how-to-and-troubleshooting/ to see if you can get extra help troubleshooting there including learning how to check the database for a broken user count (if that's a thing) and to see if there's anyone there with some time to help you try the steps you mentioned where you start with the login name admin and change it in the database by updating user_login field in the wp_users table?

If you find you're not getting replies there or if you feel strongly it's a Gutenberg bug that should have more attention here in this repo, please re-open this issue!

@designsimply designsimply added the [Feature] Document Settings Document settings experience label Dec 14, 2018
@designsimply
Copy link
Member

Since there haven't been any other similar reports of this that I can find in a quick search

I take that back.

Have a look at this previous solution that I somehow missed before (sorry about that!) saying this is most likely related to wrong permissions persisted into the database:

FWIW I encountered this issue in multisite as well and it was not an issue with Gutenberg. Instead, a plugin (I haven't yet had time to track down which one) modified the roles when creating a new subsite and destroyed the permissions which caused the who clause in all author queries in core to fail.

The solution was to repair the roles in all affected subsites using wp role reset

Source: #8526 (comment)

@vedranmiletic
Copy link
Author

I tried wp role reset --all and I got some capabilities removed from various roles, but it did not fix my issue neither in /wp-json/wp/v2/users nor in Gutenberg.

@designsimply
Copy link
Member

I'm sorry I wasn't able to help earlier! Because this appears to be a single case for a site where there have been previous modifications to the database and because I tested those changes and couldn't replicate the problem I am not sure where to go next. Would you mind asking at https://wordpress.org/support/forum/how-to-and-troubleshooting/ or https://wordpress.stackexchange.com/ to see if you can find any additional help or someone willing to try some detailed testing steps you provide that include the database modification?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Document Settings Document settings experience [Type] Help Request Help with setup, implementation, or "How do I?" questions.
Projects
None yet
Development

No branches or pull requests

2 participants