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

API returns Error but page is still created #6692

Open
linusrogge opened this issue Sep 21, 2024 · 2 comments
Open

API returns Error but page is still created #6692

linusrogge opened this issue Sep 21, 2024 · 2 comments
Labels
type: bug 🐛 Is a bug; fixes a bug

Comments

@linusrogge
Copy link

linusrogge commented Sep 21, 2024

Description

When using the API route /api/pages/:id/children to create a page, the API returns an error even though the page is still created.

Using localhost

{
    "status": "error",
    "message": "http://localhost:8000/panel/pages/entries+example",
    "code": 302,
    "exception": "Kirby\\Panel\\Redirect",
    "key": null,
    "file": "/kirby/src/Panel/Panel.php",
    "line": 149,
    "details": [],
    "route": "pages/([a-zA-Z0-9\\.\\-_%= \\+\\@\\(\\)]+)/children"
}

Using live site

{
    "status": "error",
    "message": "https://archive.saman.design/panel/pages/entries+example",
    "code": 302,
    "key": null,
    "details": []
}

Expected behavior
The API should respond with a success message, using a code between 200 and 299

To reproduce

  1. Use the API at /api/pages/:id/children (eg. with Postman) to POST a new page with basic data
  2. See Panel, page should be created
  3. Request should return an error 302 response

Your setup

Kirby Version
Tried using both v4.4.0 and v4.3.1 (due to redirect errors mentioned in #6676).

Your system (please complete the following information)

  • Device: MacBook
  • OS: MacOS 15.0
  • Browser: Chrome
@linusrogge
Copy link
Author

In addition to this, finding the API documentation on getkirby.com was a little bit of work.

I wanted to get to https://getkirby.com/docs/reference/api/pages/children-create, but clicking on API → Pages in the Reference sidebar leads me to https://getkirby.com/docs/reference/objects/cms/api/pages instead. Managed to get to the page via search, after all.

This also seems to be an issue with API → Site and API → Users.

@distantnative
Copy link
Member

Thanks for reporting this. I have already fixed the API reference links.

@distantnative distantnative added the type: bug 🐛 Is a bug; fixes a bug label Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Is a bug; fixes a bug
Projects
None yet
Development

No branches or pull requests

2 participants