Make WordPress Core

Opened 20 months ago

Last modified 3 months ago

#56410 new defect (bug)

WordPress API error when trying to add tags

Reported by: fanmerch2016's profile fanmerch2016 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: critical Version: 6.4.2
Component: Editor Keywords:
Focuses: rest-api Cc:

Description

In this video- https://www.loom.com/share/6671fc834c624e37940ba9ecf0398389 you can see that, even with all plugins deactivated and with a default theme, there is an error whenever we tried to add a new tag. As you can see in the video, there is a 400 server error related to the WordPress API.

Maybe it is showing due to - WordPress API error when trying to add tags that already exist to a existing post or within site.

I’ve run into an error in the browser console whenever I try to add tags (that already exist on the site) to a post. I’ve managed to reproduce this on a completely new site.

To reproduce this, please try the following steps:
1) Create a few tags (around 5-6) under Posts > Tags.
2) Create a new post.
3) With the browser console open, start adding your tags to the new post.
4) You should see a 400 Bad Request error for /wp-json/wp/v2/tags?_locale=user

I was able to reproduce this error on a completely new WordPress 6.0.1 install.
We then tried to reproduce this issue on a completely new WordPress installation with no plugins and we managed to reproduce this problem. It looks like this is a problem in WordPress core and not in a plugin. The error seems to be triggered only when you try to add a tag that already exists on the site.

Attachments (1)

siteinfo.txt (3.3 KB) - added by marcanor 20 months ago.

Download all attachments as: .zip

Change History (7)

#1 @azouamauriac
20 months ago

Hello @fanmerch2016 welcome to core trac and thanks for your report, I'm unable to reproduce the issue you are reporting, but I noticed that you have a mu-plugin https://prnt.sc/E1EC3l1izAyp do you mind to remove it and run the tests again? it will be great if you can send a video tape of the new WP installation without any plugin on it.

Regards.

#2 @SergeyBiryukov
20 months ago

  • Component changed from General to Editor
  • Focuses rest-api added

#3 @marcanor
20 months ago

Hi @azouamauriac ,

Please find a video on a completely new WordPress installation here.

As shown in the video, to reproduce this, please try the following steps:
1) Create a few tags (around 5-6) under Posts > Tags.
2) Create a new post.
3) With the browser console open, start adding your tags to the new post.
4) You should see a 400 Bad Request error for /wp-json/wp/v2/tags?_locale=user

I've attached the site info output from Health Check below.

Last edited 20 months ago by marcanor (previous) (diff)

@marcanor
20 months ago

#4 @rafiahmedd
20 months ago

Hi @marcanor,

I just tried to recreate this issue following your video but I can see it's working perfectly fine. Also, I tried updating an existing post. I am using PHP 7.4 & WP 6.0.1, let me know if there's any other way that I can reproduce the issue.

Thanks

#5 follow-up: @azouamauriac
20 months ago

Hello, I was able to reproduce the bug.

To reproduce it, you must quickly validate the entry of new tags before the list of proposals appears. A solution I would suggest would be to block any new request as long as there is an old one that is not completed.

the ticket should be reported on https://github.com/WordPress/gutenberg/issues/new/choose.

#6 in reply to: ↑ 5 @jhoysi
3 months ago

  • Version set to 6.4.2

Replying to azouamauriac:

Hello, I was able to reproduce the bug.

To reproduce it, you must quickly validate the entry of new tags before the list of proposals appears. A solution I would suggest would be to block any new request as long as there is an old one that is not completed.

the ticket should be reported on https://github.com/WordPress/gutenberg/issues/new/choose.

I can confirm this is the case:

  1. Start a new post
  2. Type in a tag name you know exists - hit enter immediately (before the suggestion can appear)
  3. Console shows 400 bad request response
Note: See TracTickets for help on using tickets.