Problem
orchestra_interaction_webform binds each webform submission to its process instance as the webform source entity (the OrchestraResumeHandler does this on first save), but it never removes that submission when the instance is deleted. The binding is created here, yet its lifecycle was left to consumers, so a submission is orphaned when its instance goes away and every consumer (for example the yoyaku booking stack) had to reimplement the cleanup.
Proposed resolution
- Add an InstanceSubmissionLocator service that finds, loads and deletes the submissions bound to an instance by source entity.
- Add a generic orchestra_instance_predelete hook that purges them, so any consumer of this module gets the cleanup without reimplementing it.
- Reuse the locator in WebformInteraction (the return-visit reopen) so the source-entity lookup lives in one place.
Adds a kernel test: a submission bound to an instance is found by the locator and is purged when the instance is deleted.
Issue fork orchestra-3606696
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mably commentedFix in MR !235 (from the issue fork). The submission cleanup is moved here from the yoyaku booking stack so it is generic; yoyaku is updated to delegate.
Comment #5
mably commented