diff --git a/core/lib/Drupal/Core/Ajax/AjaxResponseAttachmentsProcessor.php b/core/lib/Drupal/Core/Ajax/AjaxResponseAttachmentsProcessor.php index 45aa45e..e2382b5 100644 --- a/core/lib/Drupal/Core/Ajax/AjaxResponseAttachmentsProcessor.php +++ b/core/lib/Drupal/Core/Ajax/AjaxResponseAttachmentsProcessor.php @@ -128,7 +128,7 @@ public function processAttachments(AttachmentsInterface $response) { * An array of commands ready to be returned as JSON. */ protected function buildAttachmentsCommands(AjaxResponse $response, Request $request) { - $ajax_page_state = $request->request->get('ajax_page_state'); + $ajax_page_state = $request->query->get('ajax_page_state') ?: $request->request->get('ajax_page_state'); // Aggregate CSS/JS if necessary, but only during normal site operation. $optimize_css = !defined('MAINTENANCE_MODE') && $this->config->get('css.preprocess'); diff --git a/core/lib/Drupal/Core/Render/HtmlResponseAttachmentsProcessor.php b/core/lib/Drupal/Core/Render/HtmlResponseAttachmentsProcessor.php index 2f9aeb3..1d17f50 100644 --- a/core/lib/Drupal/Core/Render/HtmlResponseAttachmentsProcessor.php +++ b/core/lib/Drupal/Core/Render/HtmlResponseAttachmentsProcessor.php @@ -156,7 +156,7 @@ public function processAttachments(AttachmentsInterface $response) { // Take Ajax page state into account, to allow for something like // Turbolinks to be implemented without altering core. // @see https://github.com/rails/turbolinks/ - $ajax_page_state = $this->requestStack->getCurrentRequest()->get('ajax_page_state'); + $ajax_page_state = $this->requestStack->getCurrentRequest()->query->get('ajax_page_state') ?: $this->requestStack->getCurrentRequest()->request->get('ajax_page_state'); $assets->setAlreadyLoadedLibraries(isset($ajax_page_state) ? explode(',', $ajax_page_state['libraries']) : []); $variables = $this->processAssetLibraries($assets, $attachment_placeholders); // $variables now contains the markup to load the asset libraries. Update diff --git a/core/lib/Drupal/Core/Theme/AjaxBasePageNegotiator.php b/core/lib/Drupal/Core/Theme/AjaxBasePageNegotiator.php index 5cd2ee3..c761d3b 100644 --- a/core/lib/Drupal/Core/Theme/AjaxBasePageNegotiator.php +++ b/core/lib/Drupal/Core/Theme/AjaxBasePageNegotiator.php @@ -65,7 +65,7 @@ public function __construct(CsrfTokenGenerator $token_generator, ConfigFactoryIn * {@inheritdoc} */ public function applies(RouteMatchInterface $route_match) { - $ajax_page_state = $this->requestStack->getCurrentRequest()->request->get('ajax_page_state'); + $ajax_page_state = $this->requestStack->getCurrentRequest()->query->get('ajax_page_state') ?: $this->requestStack->getCurrentRequest()->request->get('ajax_page_state'); return !empty($ajax_page_state['theme']) && isset($ajax_page_state['theme_token']); } @@ -73,7 +73,7 @@ public function applies(RouteMatchInterface $route_match) { * {@inheritdoc} */ public function determineActiveTheme(RouteMatchInterface $route_match) { - $ajax_page_state = $this->requestStack->getCurrentRequest()->request->get('ajax_page_state'); + $ajax_page_state = $this->requestStack->getCurrentRequest()->query->get('ajax_page_state') ?: $this->requestStack->getCurrentRequest()->request->get('ajax_page_state'); $theme = $ajax_page_state['theme']; $token = $ajax_page_state['theme_token']; diff --git a/core/misc/ajax.js b/core/misc/ajax.js index fefe9f3..485ea26 100644 --- a/core/misc/ajax.js +++ b/core/misc/ajax.js @@ -511,7 +511,7 @@ } }, dataType: 'json', - type: 'POST' + type: typeof ajax.type !== 'undefined' ? ajax.type : 'POST' }; if (element_settings.dialog) {