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

DIS-338: Validation for Uploading Images in Web Builder #2232

Open
wants to merge 3 commits into
base: 25.03.00
Choose a base branch
from

Conversation

LeoStoyanovByWater
Copy link
Contributor

  • Introduced frontend and backend validation for uploading images with a note displaying the valid file types.

The backend validation also closely mirrors how regular file validation is done in the same DataObjectUtil.php.

To test:

  1. Navigate to Aspen Administration → Web Builder → Images and upload an invalid file type. The page will output a SQL error at the top, and the save will fail.
  2. Apply the patch and try to upload an invalid file type again. An alert will stop and notify you that the file type is invalid.
  3. If you remove the JS snippet in property.tpl to test backend validation, upload another invalid image, and you will be directed to an error page.

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

Successfully merging this pull request may close these issues.

1 participant