Create a helper trait for Forms in ajax dialogs

Created on 21 July 2017, over 7 years ago
Updated 15 September 2023, about 1 year ago

Problem/Motivation

Settings Tray and the Workflow initiative are essentially solving the same common problems with using forms in AJAX dialogs ( #2785047: In Outside In mode, form validation messages should appear in the off-canvas tray, not the main page β†’ and πŸ“Œ Use modals for creating, updating, and deleting workflows, with a new DialogFormTrait Needs review , respectively).

The problems were:

  1. Showing validation messages on form submit error while remaining in the dialog
  2. Refreshing the main page when needed
  3. Redirect to a path on successful commit

Proposed resolution

Provide a common trait that can be used simply by including the trait and $this->buildFormDialog($form, $form_state, FALSE, '#drupal-modal'); (with the last 2 arguments being optional).

Remaining tasks

?

User interface changes

None.

API changes

API addition.

Data model changes

None.

✨ Feature request
Status

Fixed

Version

8.6 ⚰️

Component
AjaxΒ  β†’

Last updated 3 days ago

Created by

πŸ‡ΊπŸ‡ΈUnited States tedbow Ithaca, NY, USA

Live updates comments and jobs are added and updated live.
  • Blocks-Layouts

    Blocks and Layouts Initiative. See the #2811175 Add layouts to Drupal issue.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024