Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fixing issue where custom default value without a 'value=' within the script would return an empty string. #6049

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

travist
Copy link
Member

@travist travist commented Mar 13, 2025

Link to Jira Ticket

https://formio.atlassian.net/browse/FIO-XXXX

Description

There was a bug that I fixed in the previous pr ( #6048 ) that was attempting to protect the case where no "value=" is provided within the customDefaultValue as well as the calculatedValue evaluations. Previously, this would return an empty string, which would then set the defaultValue to an empty string causing major problems for incompatible datatypes.

This PR reverts the "fix" from the previous PR and implements a better change which is to default the value passed to the evaluation context with the current dataValue of the component, which is what it should be. This way, if the user does not provide a "value=" within the evaluation, then it will return the current dataValue.

Breaking Changes / Backwards Compatibility

This may break any implementations that previously expected an empty string return as the result of customDefaultValue.

Dependencies

None

How has this PR been tested?

Manual testing

Checklist:

  • I have completed the above PR template
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • My changes include tests that prove my fix is effective (or that my feature works as intended)
  • New and existing unit/integration tests pass locally with my changes
  • Any dependent changes have corresponding PRs that are listed above

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

Successfully merging this pull request may close these issues.

1 participant