Show custom acceptMessage for unsupported file type in File Attachment - #1941
Closed
mayankjindalmj wants to merge 1 commit into
Closed
Show custom acceptMessage for unsupported file type in File Attachment#1941mayankjindalmj wants to merge 1 commit into
mayankjindalmj wants to merge 1 commit into
Conversation
…n file input The file-input widget's invalidMessage() looked up constraintMessages.invalidMimeType for the unsupported-file-type alert, but invalidMimeType is not an authorable constraint message key - the schema only exposes constraintMessages.accept (backed by the acceptMessage dialog property). As a result the custom message authors configure for file type validation was always ignored in favor of the generic fallback string, while the analogous maxFileSize custom message worked correctly since its key matched. Updated both the webpack source (ui.frontend) and the apps clientlib copy (ui.af.apps) to read constraintMessages.accept, and added a Cypress assertion mirroring the existing maxFileSize custom-message test.
mayankjindalmj
marked this pull request as ready for review
July 31, 2026 09:33
Contributor
Author
|
Closing in favor of the dev-targeted PR (same fix + test, cherry-picked). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Original PR #1928 couldn't be merged due to a fork.
Summary
invalidMessage()looked upconstraintMessages.invalidMimeTypefor the "unsupported file type" alert, butinvalidMimeTypeis not an authorable constraint message key — the schema only exposesconstraintMessages.accept(backed by theacceptMessagedialog property, seeAbstractBaseImpl.ConstraintMessages#getAcceptConstraintMessage).maxFileSizecustom message worked correctly since its key matched (constraintMessages.maxFileSize).ui.frontend/src/view/FormFileInputWidgetBase.js) and the apps clientlib copy (ui.af.apps/.../fileinput/v4/fileinput/clientlibs/site/js/fileinputwidget.js).Root cause (reproduced live)
maxFileSizemessage ✅acceptMessage)accept/acceptMessagetext ✅Test plan
node --checkon both modified JS filesshould display a custom error message configured by the user for unsupported file typeinfileinputv4.runtime.cy.js, mirroring the existingmaxFileSizecustom-message testacceptMessageto thefileinput7fixture field in the IT sample content used by that spec