Automattic / Co-Authors-Plus

Multiple bylines and Guest Authors for WordPress
https://wordpress.org/plugins/co-authors-plus/
GNU General Public License v2.0
287 stars 205 forks source link

Gutenberg widget fails with more than 50 guest authors #1050

Open antonlukin opened 1 month ago

antonlukin commented 1 month ago

When the site has more than 50 guest authors, the Gutenberg widget may malfunction and display an infinite spinner after loading. This issue seems to be caused by the API returning only the first 50 records in alphabetical order. If an author outside of this list is selected, the plugin fails to retrieve the necessary value.

Steps to Reproduce: Add more than 50 guest authors to the site. Open the Gutenberg editor and try to use the widget. Select a guest author that is alphabetically beyond the first 50 in the list.

Expected Result: The widget should function correctly and display the selected guest author.

Actual Result: The widget shows an infinite spinner and does not load properly.

Additional Information: It appears that the API call is limited to 50 records. The plugin needs to handle pagination or request more records to include all guest authors. https://github.com/Automattic/Co-Authors-Plus/blob/1c29766eeda11276bcf6f20e07171b3efcbc7c03/src/components/co-authors/index.jsx#L73

image