WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.39k stars 4.15k forks source link

Suggestion for internal links not working on Gutenberg paragraph block (Multisite) #34125

Open tezell-mg opened 3 years ago

tezell-mg commented 3 years ago

Description

When on a multisite network and in the Gutenberg paragraph block editor the link suggestion feature is not working. It works fine on single site.

image

Console error: image

In case the image is too hard to read on the consol error "GET http://sage-life-site-network.lndo.site/wp-json/wp/v2/search?search=55&per_page=20&type=term&_locale=user" "400 Bad Request"a

Step-by-step reproduction instructions

  1. On a site within a multisite network create and publish a page (Page A)
  2. Create a second page and on that page (using the Gutenberg paragraph block) add text to that page.
  3. Select some of the text and click the Link button.
  4. Begin to type the title of the page created in Step 1

Notice that the suggestion functionality does not work. This is the issue.

Screenshots, screen recording, code snippet

multisite-link-suggestion-img-1 multisite-link-suggestion-img-2

Environment info

WordPress Version: 5.7 All Browsers MacOS 11.1

Pre-checks

getdave commented 2 years ago

@anton-vlasenko @spacedmonkey Are either of you familiar with any quirks of multisite which might make the search endpoint of the REST API not work? For example, would we need to pass a blogID when making the request?

mrfoxtalbot commented 2 years ago

@igmoweb, @jconti, do you have any thoughts on what could be causing this feature not to work as expected in multisite? Thank you!

getdave commented 2 years ago

For clarity here is the endpoint being requested in the code

https://github.com/WordPress/gutenberg/blob/9d1d8e3e6ef956a5f2aa9d5863f535c7f55862a6/packages/core-data/src/fetch/__experimental-fetch-link-suggestions.js#L102