// First, render the actual placeholders; this may cause additional
// attachments to be added to the response, which the attachment
// placeholders rendered by renderHtmlResponseAttachmentPlaceholders() will
// need to include.
//
// @todo Exceptions should not be used for code flow control. However, the
// Form API does not integrate with the HTTP Kernel based architecture of
// Drupal 8. In order to resolve this issue properly it is necessary to
// completely separate form submission from rendering.
// @see https://www.drupal.org/node/2367555
try { $response =
$this->
renderPlaceholders($response);
} catch (EnforcedResponseException
$e) { return $e->
getResponse();
} // Get a reference to the attachments.
$attached =
$response->
getAttachments();
// Send a message back if the render array has unsupported #attached types.
$unsupported_types =
array_diff( array_keys($attached),
[