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

Multi-page webform invalid data with image #897

Merged
merged 1 commit into from
Aug 6, 2023

Conversation

jitendrapurohit
Copy link
Collaborator

Overview

Data not submitted when upload image element is present in the multi-page webform setup.

Before

When having a multi-step form (with or without preview) and on one of the steps/pages we got a contact image field (file upload field), the submitted data do not keep the other changes but just the contact's image.

See drupal ticket for details - https://www.drupal.org/project/webform_civicrm/issues/3372150

After

Data submitted without any issues.

Technical Details

When you upload a file using a managed_file element, it involves AJAX requests behind the scenes, which trigger the form alteration hooks.

This patch prevents alterForm method from being called when you upload a file.

Comments

Drupal Ticket - https://www.drupal.org/project/webform_civicrm/issues/3372150

@jitendrapurohit
Copy link
Collaborator Author

This PR is tested by VangelisP on the drupal ticket - https://www.drupal.org/project/webform_civicrm/issues/3372150#comment-15169899

@KarinG Can we merge this?

@jitendrapurohit jitendrapurohit merged commit 6ea328b into colemanw:6.x Aug 6, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant