Skip to content

[DEFECT] Improve error handling for asset upload when 'System Indexed' is unchecked #34533

@dario-daza

Description

@dario-daza

Problem Statement

When a client using the Asset API (PUT /api/v1/assets) tries to upload assets with the "System Indexed" option unchecked on the "File Asset" field of the "File Asset" content type, the API returns a 500 error. This error is not informative and makes it difficult to troubleshoot the issue. The API should handle this scenario gracefully and provide a clear error message.

Steps to Reproduce

  1. In dotCMS, navigate to the Content Model -> Content Types.
  2. Edit the "File Asset" content type.
  3. Edit the "File Asset" field.
  4. Uncheck the "System Indexed" option and save.
  5. Reindex the File Asset Content Type (Maintenance/INDEX tab).
  6. Attempt to upload a file asset using the PUT /api/v1/assets endpoint.
  7. Observe the 500 Internal Server Error response.

Acceptance Criteria

  • When uploading an asset via the API and the "System Indexed" option is unchecked, the API should not return a 500 error.
  • The API should return a meaningful error response (e.g., a 4xx status code) with a message indicating that the "System Indexed" option must be enabled for the "File Asset" field.

dotCMS Version

Latest from main branch

Severity

Medium - Some functionality impacted

Links

Ticket support

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions