Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Collaborator
|
@orshih6 thanks for your contribution :) Please correctly sign-off your commit so that the pipeline gets green |
Collaborator
|
/backport to stable5.4 |
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.
When a respondent types into an optional short-text question that has a validation type (email, phone, number or regex) and then clears it, the frontend still sends
['']for that question.validateSubmissionthen passed the empty string tovalidateShortQuestion, which rejected it. The result was "Invalid input for question ..." and the form couldn't be submitted.Empty answers are already dropped when answers are stored (
storeAnswersForQuestionskips''), so an empty short answer just means "not answered". Format validation is now skipped for it. Required questions are unaffected, because the earlier required check still rejects an empty answer with "Question ... is required.".Tests: I added two
testValidateSubmissiondata sets, an empty email answer on an optional question (now accepted) and on a required question (still rejected as required). The first one fails without this change. I ran thetestValidateSubmissioncases fromSubmissionServiceTestwith PHPUnit 10.5 and thenextcloud/ocpstubs, not a full server checkout, and they all pass. php-cs-fixer reports no changes.Fixes #3802
This change was prepared with an AI coding agent (Claude) and reviewed by me before submitting. I'm happy to make any changes you'd like.