Manual preview doesn't work with form validation

Created on 2 July 2025, about 1 month ago

Problem/Motivation

If live previews are set to Manual, the preview and save buttons are broken if there are form validation errors after trying to save a block.

Steps to reproduce

  1. Install the latest Panopoly 3.0.x with demo content.
  2. At /admin/panopoly/preview, set live previews to Manual and save.
  3. Visit a content page.
  4. Click the Layout tab.
  5. Click Add block in one of the sections.
  6. Select Add Text.
  7. In the configure block dialog, enter some text in the required Title field.
  8. Without adding anything to the required Text field, click Save.
  9. Note the validation message "Text field is required" appears at the top of the modal.
  10. Scroll down to the bottom of the modal.
  11. Note the Preview and Save buttons appear twice.
  12. Click the 2nd of the two Preview buttons.
  13. Open the developer console.
  14. Note the JS error with stack trace:
jquery.min.js?v=3.7.1:2 Form submission canceled because the form is not connected
trigger @ jquery.min.js?v=3.7.1:2
(anonymous) @ jquery.min.js?v=3.7.1:2
each @ jquery.min.js?v=3.7.1:2
each @ jquery.min.js?v=3.7.1:2
trigger @ jquery.min.js?v=3.7.1:2
click @ panopoly_magic.preview.base.js?v=10.4.8:43
(anonymous) @ dialog.js:527
dispatch @ jquery.min.js?v=3.7.1:2
v.handle @ jquery.min.js?v=3.7.1:2

Screenshot:

Proposed resolution

It looks like the prepareDialogButtons function either isn't firing, or is erroring, after clicking the Save button when not all required fields are filled out.

Remaining tasks

Fix the JS.

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Active

Version

3.0

Component

Magic

Created by

πŸ‡ΊπŸ‡ΈUnited States cboyden

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024