Skip to content

Conversation

dhasilva
Copy link
Contributor

@dhasilva dhasilva commented Sep 5, 2025

Part of FORMS-60

Proposed changes:

  • Fixes some issues with the images
  • Changes the way the values are saved, so each place the information is displayed can have its own rendering method

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

Does this pull request change what data or activity we track or use?

Testing instructions:

  • Delete all submissions with image select blocks in them, as this is a breaking change
  • Enable the forms-alpha flag
  • Make a form with one or more image select fields (and other fields as well), enabling randomization on one of them
  • Publish it and submit the form
  • Check that the post-publish screen is displayed with the letter you see when you selected the image (which can be different from the one in the editor if randomization is enabled) and the images
  • Reload the page
  • Check that the post-publish screen is still rendered correctly
  • Check the email you received. You should see the letters as they are in the editor, pre-randomization
  • Check the dashboard. You should see the letters as they are in the editor, pre-randomization, and the selected images
  • Export the submission. You should see the pre-randomization letters separated by comma

Editor:
Screenshot from 2025-09-04 22-47-03

Frontend (option A got randomized to B):
Screenshot from 2025-09-04 22-49-35

Post-submission screen (user sees the choice from their point of view: B):
Screenshot from 2025-09-04 22-44-39

Email (admin's point of view from now on: A):
Screenshot from 2025-09-04 22-44-49

Dashboard:
2025-09-04_22-45

Export:
2025-09-04_22-46

@dhasilva dhasilva requested a review from a team September 5, 2025 01:53
@dhasilva dhasilva self-assigned this Sep 5, 2025
@dhasilva dhasilva added [Status] Needs Review This PR is ready for review. [Type] Task I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. labels Sep 5, 2025
Copy link
Contributor

github-actions bot commented Sep 5, 2025

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the update/forms-image-select-field-data-display branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack update/forms-image-select-field-data-display

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

Copy link
Contributor

github-actions bot commented Sep 5, 2025

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add a "[Type]" label (Bug, Enhancement, Janitorial, Task).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

Copy link

jp-launch-control bot commented Sep 5, 2025

Code Coverage Summary

Coverage changed in 7 files. Only the first 5 are listed here.

File Coverage Δ% Δ Uncovered
projects/packages/forms/src/contact-form/class-contact-form.php 574/1075 (53.40%) -1.33% 27 💔
projects/packages/forms/src/contact-form/class-feedback-field.php 124/155 (80.00%) -15.93% 26 💔
projects/packages/forms/src/contact-form/class-contact-form-field.php 805/1395 (57.71%) -0.88% 21 💔
projects/packages/forms/src/contact-form/class-feedback.php 456/484 (94.21%) -3.42% 17 💔
projects/packages/forms/src/modules/form/view.js 0/248 (0.00%) 0.00% 7 💔

Full summary · PHP report · JS report

Coverage check overridden by I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. .

LiamSarsfield added a commit that referenced this pull request Sep 5, 2025
…ck (#45080)

* Added logic to process $instance['content'] as an array, ensuring compatibility with nested structures and serialization of block arrays.
* Improved validation to return early if content is not a valid string after processing.
@dhasilva dhasilva force-pushed the update/forms-image-select-field-data-display branch 2 times, most recently from 8e5f30c to fb3bc1c Compare September 6, 2025 00:20
@dhasilva dhasilva force-pushed the update/forms-image-select-field-data-display branch from fb3bc1c to 9b038d0 Compare September 8, 2025 20:05
@dhasilva dhasilva merged commit cba8f56 into trunk Sep 8, 2025
67 checks passed
@dhasilva dhasilva deleted the update/forms-image-select-field-data-display branch September 8, 2025 20:33
@github-actions github-actions bot removed the [Status] Needs Review This PR is ready for review. label Sep 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Contact Form Form block (also see Contact Form label) [Feature] Contact Form I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. [Package] Forms [Type] Task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant