Skip to content

FIO-10213: DataSource should add fecthed data into context.data to ma…#261

Closed
yauheni-formio wants to merge 1 commit intomasterfrom
fix/FIO-10213_dataSource_not_working_with_custom_conditional_components
Closed

FIO-10213: DataSource should add fecthed data into context.data to ma…#261
yauheni-formio wants to merge 1 commit intomasterfrom
fix/FIO-10213_dataSource_not_working_with_custom_conditional_components

Conversation

@yauheni-formio
Copy link
Copy Markdown

@yauheni-formio yauheni-formio commented Jun 5, 2025

…ke custom conditional components work properly

Link to Jira Ticket

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

Description

What changed?

I leave dataSource fetched data in context.data (Previously fetched data does not get into context.data due to filterPostProcess). Components with custom conditional logic tied to dataSource fecthed data can now handle it correctly and set the correct flags in conditionallyHidden. This allows us to fix the behavior when the submission contains hidden fields.

Breaking Changes / Backwards Compatibility

n/a

Dependencies

This PR is added into formio/formio#1998

How has this PR been tested?

Manually. A test added here: formio/formio#1998

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

…ke custom conditional components work properly
Copy link
Copy Markdown
Contributor

@brendanbond brendanbond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem like a good way to determine the model type for Data Source components. Can we discuss your thinking here?

@yauheni-formio
Copy link
Copy Markdown
Author

yauheni-formio commented Jun 6, 2025

Yeah, my first thought was to add this piece of code here. Then no more changes need to be made in the core. Works the same. Will this be a normal solution?
image

@yauheni-formio
Copy link
Copy Markdown
Author

yauheni-formio commented Jun 6, 2025

One small addition. In server processes we fetch data for dataSource, in evaluate process we process custom logic, which is tied to fetchedData. If we remove fetchedData in filterPostProcess from context.data, then evaluate process cannot work correctly for conditions with custom logic. That's why you need to leave fetched Data as I stated above

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.

2 participants