Skip to content

[5.x]: generate-transform with no body params throws 500 error #17228

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

Closed
jeroenlammerts opened this issue May 7, 2025 · 2 comments
Closed

[5.x]: generate-transform with no body params throws 500 error #17228

jeroenlammerts opened this issue May 7, 2025 · 2 comments
Labels

Comments

@jeroenlammerts
Copy link
Contributor

What happened?

Description

/index.php?p=actions/assets/generate-transform is throwing an 500 error instead of 400 bad request.

https://github.com/craftcms/cms/blob/5.x/src/controllers/AssetsController.php#L1127
The try/catch block is handling the BadRequestHttpException and throws a ServerErrorHttpException.
Causing 2 errors in the error log.

Steps to reproduce

  1. Do a post request to /index.php?p=actions/assets/generate-transform with no params.

Expected behavior

Throw a bad request 400 error.

Actual behavior

Throws a 500 error

Craft CMS version

5.7.1.1

PHP version

8.3.16

Operating system and version

Ubuntu

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

@brandonkelly
Copy link
Member

Thanks for pointing that out! Just improved assets/generate-transform responses for the next Craft 4 and 5 releases.

@brandonkelly
Copy link
Member

Craft 4.15.4 and 5.7.6 are out with that change. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants