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

FIO-9480: establish parent references before subform creation (5.0.x) #5953

Merged
merged 2 commits into from
Dec 23, 2024

Conversation

brendanbond
Copy link
Contributor

@brendanbond brendanbond commented Dec 22, 2024

Link to Jira Ticket

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

Description

Sometimes a deeply nested child needs state or data from a distant parent, and needs to crawl up the reference tree to get it. E.g. a calculated value that looks like

const myValue = instance?.root.parent?.root?.parent?.root?.parent?.data?.role;

Previously these references were not stable, because they were being instantiated after subForm creation. This PR fixes this behavior so that they are passed along with the creation options, and those references will be stable from the start.

Breaking Changes / Backwards Compatibility

n/a

Dependencies

n/a

How has this PR been tested?

NOTE: tests seem to be broken in the 5.0.x branch.

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

@brendanbond brendanbond changed the title FIO-9480: establish parent references before subform creation FIO-9480: establish parent references before subform creation (5.0.x) Dec 22, 2024
@lane-formio lane-formio merged commit 501b4dd into 5.0.x Dec 23, 2024
3 of 5 checks passed
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