// attribute.
if (!
empty($form_state->
get('filter_default_view_mode'
)) &&
$form_state->
getValue(['attributes', 'data-view-mode'
]) ===
$form_state->
get('filter_default_view_mode'
)) { $form_state->
setValue(['attributes', 'data-view-mode'
], FALSE
);
} if ($form_state->
getErrors()) { unset($form['#prefix'
],
$form['#suffix'
]);
$form['status_messages'
] =
[ '#type' => 'status_messages',
'#weight' => -10,
];
$response->
addCommand(new HtmlCommand('#editor-media-dialog-form',
$form));
} else { // Only send back the relevant values.
$values =
[ 'hasCaption' =>
$form_state->
getValue('hasCaption'
),
'attributes' =>
$form_state->
getValue('attributes'
),
];
$response->
addCommand(new EditorDialogSave($values));
$response->
addCommand(new CloseModalDialogCommand());
}