Problem/Motivation

Submitting the contact form on /contact-us stores the submission correctly, but the visitor never sees the confirmation. Instead the page shows:

Oops, something went wrong. Check your browser's developer console for more details.

and, alongside it, a validation message that is not true of the value submitted:

Invalid phone number  /  The phone number is not valid. (e.g. 000 000-0000)

The submission IS saved. Verified in the database: five submissions were stored while the browser reported failure every time, which is the real damage - a visitor who is told the form failed simply submits again.

Mechanically, the AJAX POST returns 200 with content-type: text/html - a full rendered page - where Drupal's AJAX layer expects JSON, so Drupal.AjaxError is raised and the confirmation never replaces the form. The server-side cause is logged:

Twig\Error\RuntimeError occurred during rendering of component
e35f7f76-b49e-4356-9bd3-46863e47d7ce in Page Contact Us (10), field components:
An exception has been thrown during the rendering of a template ("") at line 7.

Probable shared root cause. The webform component on that page is:

component_id: block.webform_block
component_version: b5dca6ca0519bf1b     (the component config entity only has: active)

That is one of the unresolvable component versions described in #3620989, so Canvas renders it through its fallback source. This issue is filed separately because it is the user-visible half and may need its own fix or test, but it should probably be resolved together with #3620989 rather than independently.

Reproduced identically on two independent installs (Drupal CMS + Educare 1.0.x-dev, and an earlier build), so it is not environmental.

Steps to reproduce

  1. Install Drupal CMS with the Educare site template.
  2. As an anonymous visitor, open /contact-us.
  3. Fill in every required field with valid values and submit.
  4. Observe "Oops, something went wrong" and the phone validation message; no confirmation appears.
  5. Check the stored submissions - the submission is there:
    drush sql:query "SELECT COUNT(*) FROM webform_submission"
  6. Check the log for the Twig RuntimeError on Page Contact Us (10).

Proposed resolution

Make the AJAX submit return the expected JSON so the confirmation renders, by fixing the render failure of the webform component on the Contact page. If #3620989 is resolved so the component resolves its real version instead of falling back, this may go with it - that should be confirmed before writing a separate fix.

Separately, the phone element is #international: true with #international_initial_country: us; the message shown does not describe the value that was actually posted, so the validation feedback needs checking once the AJAX path returns JSON again.

Remaining tasks

  • ✅ File an issue
  • ❌ Confirm whether #3620989 resolves this
  • ❌ Addition/Change/Update/Fix
  • ❌ Testing to ensure no regression
  • ❌ Automated functional testing coverage
  • ➖ Developer Documentation support
  • ➖ User Guide Documentation support
  • ➖ UX/UI designer responsibilities
  • ❌ Accessibility and Readability
  • ❌ Reviewed by a human
  • ❌ Code review by maintainers
  • ❌ Full testing and approval
  • ❌ Credit contributors
  • ❌ Review with the product owner
  • ❌ Update Release Notes
  • ❌ Release

User interface changes

  • The contact form will show its confirmation instead of an error after a successful submission.

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

  • N/A until fixed.

Comments

rajab natshah created an issue.