Skip to content
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

Console error in Editor: GET 400 (Bad Request), code: rest_invalid_type, message: post[0] is not of type integer. #66882

Closed
3 of 6 tasks
realthemes opened this issue Nov 8, 2024 · 1 comment
Labels
REST API Interaction Related to REST API [Type] Bug An existing feature does not function as intended

Comments

@realthemes
Copy link

Description

Hello, I am getting a console error on a clean local WordPress 6.6.2 installation with the latest Gutenberg plugin:

Failed to load resource: the server responded with a status of 400 (Bad Request)
http://local.test/wp-json/wp/v2/comments?context=edit&post=twentytwentyfour%2F%2Fhome&type=block_comment&status=any&per_page=100&_locale=user

If I open this link, I'm getting this:

{
    "code": "rest_invalid_param",
    "message": "Invalid parameter(s): post",
    "data": {
        "status": 400,
        "params": {
            "post": "post[0] is not of type integer."
        },
        "details": {
            "post": {
                "code": "rest_invalid_type",
                "message": "post[0] is not of type integer.",
                "data": {
                    "param": "post[0]"
                }
            }
        }
    }
}

Step-by-step reproduction instructions

  1. Install clean WordPress 6.6.2 in local environment.
  2. Install Gutenberg plugin.
  3. Open Editor (click Home template to get inside Editor).
  4. Check console for errors.

Screenshots, screen recording, code snippet

Image

Environment info

  • WordPress 6.6.2, Gutenberg 19.6.1, TwentyTwentyFour theme.
  • Edge Browser.
  • Desktop with Windows 11.

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure
@realthemes realthemes added the [Type] Bug An existing feature does not function as intended label Nov 8, 2024
@t-hamano
Copy link
Contributor

t-hamano commented Nov 9, 2024

Thanks for the report. I was also able to reproduce this issue in Gutenberg 19.6.1, but I noticed that this issue does not occur in trunk. After investigating, I found that this issue was resolved by #66670.

Therefore, this issue will be resolved in Gutenberg 19.7.

@t-hamano t-hamano closed this as not planned Won't fix, can't repro, duplicate, stale Nov 9, 2024
@t-hamano t-hamano added the REST API Interaction Related to REST API label Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
REST API Interaction Related to REST API [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

2 participants