Skip to content

[Bug] Saving metadata with page count set to 0 causes HTTP 400 error #329

Description

@van-geaux

What went wrong?

Saving metadata fails with an HTTP 400 error if the page count is set to 0.

This can happen after using auto-fill. In some cases, the page count is filled as 0 from the metadata source, so the invalid value is not necessarily entered manually by the user.

Steps to reproduce

  1. Open the metadata editor for a book.
  2. Set the page count field to 0.
  3. Save the metadata.

Expected vs actual behavior

Expected behaviour:
The metadata should save successfully, or the UI should clearly prevent 0 as an invalid value before saving.

Actual behaviour:
Saving fails with an HTTP 400 error when the page count is set to 0.

If 0 is not a valid page count, it may be better to clean or normalize the input so 0 is converted back to null / empty instead of being submitted and causing an HTTP 400 error.

Your setup

BookOrbit version tag: 1.10.0
Deployment: docker
OS: Debian Trixie
Browser: Firefox 151.0.4

Relevant logs (optional)

Screenshots (optional)

No response

Before submitting

  • I've searched existing issues and this hasn't been reported yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreleasedIssue or PR is included in a released version.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions