Skip to content
Snippets Groups Projects

Added fix to display form errors inline within the modal

Open Joshua Fernandes requested to merge issue/drupal-3388950:3388950-message-placement into 11.x
Files
2
@@ -145,6 +145,16 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'query' => $this->getMediaLibraryState($form_state)->all(),
])->toString();
// Display messages after the input field but before the Views select form
// is displayed in the modal.
$form['media_library_messages'] = [
'#type' => 'container',
'#attributes' => [
'id' => 'media-library-messages',
],
'#weight' => 999,
];
// The form is posted via AJAX. When there are messages set during the
// validation or submission of the form, the messages need to be shown to
// the user.
Loading