Author dropdown does not show all users.
List of 120 users
List of 100 users
List of 120 users
Use X-WP-TotalPages and/or X-WP-Total headers in REST API response to get missing users.
@tkes A couple follow-up questions to clarify:
Thanks!
Thanks @tkes — appreciated.
There is a hard limit here: https://github.com/WordPress/gutenberg/blob/master/editor/components/post-author/index.js#L88
@spencerfinnell Correct. wp/v2/users has a per_page cap of 100 items. We'd either need to:
@danielbachhuber The only acceptable solution is 1.
Similar code will be required anyway to fix #4632, #4623 and more issues like missing tag entries, missing custom taxonomy entries, etc.
And the hardcoded ? in REST API call needs to be fixed as well, it won't work with plain permalinks, as explained here by @bobbingwide
Another idea would be to load the initial set of users when Gutenberg loads, and then progressively load all remaining users when the UI element is focused.
@danielbachhuber "Another idea" would fail. If real author is not in initial set of users, saving the post without focusing UI element would still unintentionally change its author.
What about adding a (debounced) search feature here so you could start typing the username and drill down to the correct user?
Some other things to note:
So is the need here to add some sort of pagination/traverse options to withAPIData?
As an alternative, could the query params include roles=editor,administrator,author,contributor? The only reason we hit the 100 user limit is because of push notification subscribers...
_This ticket was mentioned in Slack in #core-editor by jeffpaul. View the logs._
2.4.0: I just attempted monkey-patching the query to test for .level_10 but for some reason still seeing everybody irrelevant.
Pushed a proposed fix that changes the selector into a searchable dropdown in https://github.com/WordPress/gutenberg/pull/5921/.
Worth noting the existing classic editor selector dropdown also has some scalability issues, especially when you get to thousands of users which isn't at all uncommon for WordPress sites. This trac ticket covers the discussion which includes mention of a search picker like the one included on the PR:
Most helpful comment
Pushed a proposed fix that changes the selector into a searchable dropdown in https://github.com/WordPress/gutenberg/pull/5921/.
Worth noting the existing classic editor selector dropdown also has some scalability issues, especially when you get to thousands of users which isn't at all uncommon for WordPress sites. This trac ticket covers the discussion which includes mention of a search picker like the one included on the PR:
https://core.trac.wordpress.org/ticket/19867