-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Link Suggestions Missing #45549
Comments
When typing in the link search input, for working sites I see 2 network requests like this:
For sites experiencing this issue, a third request is issued which errors and I suspect is the culprit:
The response to this bad request is like: {
"body": {
"code": "rest_invalid_param",
"message": "Invalid parameter(s): type",
"data": {
"status": 400,
"params": {
"type": "type is not one of post, term."
}
}
},
"status": 400,
"headers": {
"Allow": "GET"
}
} |
I think we'd want to start searching around here for why the additional search is being triggered: https://github.com/WordPress/gutenberg/blob/7e8ab3aa2d1db03b30480d6f224e9df5e5eb601e/packages/block-editor/src/components/link-control/search-input.js |
Had this happen to a user trying to add links to images. I checked my test site and was able to replicate on their theme Rosalie, as well as another premium theme Floral, but Aquene (also premium) didn't have the same issue. The free themes I tested (Independent Publisher 2 and Maywood) didn't have this issue either. |
It was just a regular site I was testing on. Nothing special. I used the Purpose theme. This could be a theme glitch. When I switched to Twenty Twenty it worked as expected. The person who reported it to me had Twenty Sixteen as their theme. |
Very helpful! It happens as soon as I activate Twenty Sixteen theme on my test site. |
Another report in #3302530-zd - in this case it was a Twenty Fourteen theme. → Suggested the user to switch to a newer theme or copy and paste full post links. |
Do you think this is something that should be reported to each theme separately? 🤔 |
I've just tested a .org site with Twenty Sixteen and I see the same 3 requests, however the third |
I think we're also seeing the issue in 18683174-hc. User did not want to switch themes during the chat however. |
Another issue in #3303984-zen |
Another report here #3305962-zd Theme: Lovecraft I can reproduce this with this theme as well. |
New report for #3312216-zd Theme: Hemmingway Rewritten |
An additional report in #3302530-zd Theme: twenty fourteen |
Alright, I think I have the full picture. There are three points of failure here, fixing any of them would fix the issue:
|
reported on #24125300-hc |
Reported in #24153733-hc |
@alshakero @p-jackson Can it be filtered to temporarily return empty array instead, so that problem would be fixed on .com? The 3rd option will still need to wait for Gutenberg release and could take weeks. 3rd option does seem like the best fix tho. |
This was reported in #14139879-hc |
A new finding. The backend side still checks for theme support before accepting 'post-format' query, whereas gutenberg's frontend doesn't. Causing a disparity and sending of faulty queries Backend check: https://github.com/WordPress/gutenberg/blob/master/lib/rest-api.php#L338 To clarify, the line in the backend code adds |
Another user report 3311082-zd and I was also able to reproduce this issue on my own site. |
Another user report: #23584900-hc |
Another user report: #24207004-hc Using Floral Theme. I was able to replicate this using the Floral Theme on my site and switching to Twenty Twenty solved it. |
I just saw this while testing Gutenberg Edge. Site uses Baskerville. |
I'm working on a "fix" that returns an empty array for D49783-code |
Another user report: 3320854-zd -- the site is using Baskerville 2 theme |
I think I understand the issue better now. In this PR from 24 days ago the In this commit, the Gutenberg search handler only registers the Adding |
Typically in those cases we do: switch_to_blog( $blog_id );
// Do the thing
restore_current_blog(); |
Yes I found this function but it didn't make a difference. I hardcoded the blog id like so: switch_to_blog( 565465 ); // 565465 is arbitary And the |
I've deployed D49783-code so the issue should be fixed for simple site users now. I've checked all the reports linked above and luckily they're all simple sites afaict. |
Closing issue as this should now be fixed for users on wpcom. Please feel free to re-open if that's not the case! WordPress/gutenberg#25302 is technically tracking the underlying issue in the GB repo, which feels like a more appropriate place. |
Steps to reproduce
What I expected
I expected to see suggestions.
What happened instead
The box where suggestions usually go remained empty.
Browser / OS version
I tried on
Firefox - 80.0.1 (64-bit) and
Chrome - Version 85.0.4183.83 (Official Build) (64-bit)
Screenshot / Video
Screenshot -
Screencast -
https://d.pr/i/sOjYFy (I'm not embedding since it just blinked when I did).
My console showed
We'd also love to know how you found the bug: #user-report
The text was updated successfully, but these errors were encountered: