Loading core/lib/Drupal/Core/Ajax/AjaxResponseAttachmentsProcessor.php +1 −1 Original line number Diff line number Diff line Loading @@ -132,7 +132,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->all('ajax_page_state'); $ajax_page_state = $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'); Loading core/lib/Drupal/Core/Render/Element/RenderElement.php +2 −0 Original line number Diff line number Diff line Loading @@ -244,6 +244,7 @@ public static function processAjaxForm(&$element, FormStateInterface $form_state * - #ajax['event'] * - #ajax['prevent'] * - #ajax['url'] * - #ajax['type'] * - #ajax['callback'] * - #ajax['options'] * - #ajax['wrapper'] Loading Loading @@ -340,6 +341,7 @@ public static function preRenderAjaxForm($element) { // to be substantially different for a JavaScript triggered submission. $settings += [ 'url' => NULL, 'type' => 'POST', 'options' => ['query' => []], 'dialogType' => 'ajax', ]; Loading core/lib/Drupal/Core/Theme/AjaxBasePageNegotiator.php +2 −2 Original line number Diff line number Diff line Loading @@ -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->all('ajax_page_state'); $ajax_page_state = $this->requestStack->getCurrentRequest()->get('ajax_page_state'); return !empty($ajax_page_state['theme']) && isset($ajax_page_state['theme_token']); } Loading @@ -73,7 +73,7 @@ public function applies(RouteMatchInterface $route_match) { * {@inheritdoc} */ public function determineActiveTheme(RouteMatchInterface $route_match) { $ajax_page_state = $this->requestStack->getCurrentRequest()->request->all('ajax_page_state'); $ajax_page_state = $this->requestStack->getCurrentRequest()->get('ajax_page_state'); $theme = $ajax_page_state['theme']; $token = $ajax_page_state['theme_token']; Loading core/misc/ajax.js +9 −1 Original line number Diff line number Diff line Loading @@ -325,6 +325,13 @@ elementSettings.url = href; elementSettings.event = 'click'; } const type = $linkElement.data('ajax-type'); /** * In case of setting custom ajax type for link we rewrite ajax.type. */ if (type) { elementSettings.type = type; } Drupal.ajax(elementSettings); }); }; Loading Loading @@ -391,6 +398,7 @@ */ Drupal.Ajax = function (base, element, elementSettings) { const defaults = { type: 'POST', event: element ? 'mousedown' : null, keypress: true, selector: base ? `#${base}` : null, Loading Loading @@ -591,7 +599,7 @@ }, dataType: 'json', jsonp: false, type: 'POST', type: ajax.type, }; if (elementSettings.dialog) { Loading core/modules/big_pipe/src/Render/BigPipe.php +2 −2 Original line number Diff line number Diff line Loading @@ -465,7 +465,7 @@ protected function sendNoJsPlaceholders($html, $no_js_placeholders, AttachedAsse // - the HTML to load the CSS can be rendered. // - the HTML to load the JS (at the top) can be rendered. $fake_request = $this->requestStack->getMainRequest()->duplicate(); $fake_request->request->set('ajax_page_state', ['libraries' => implode(',', $cumulative_assets->getAlreadyLoadedLibraries())]); $fake_request->query->set('ajax_page_state', ['libraries' => implode(',', $cumulative_assets->getAlreadyLoadedLibraries())]); try { $html_response = $this->filterEmbeddedResponse($fake_request, $html_response); } Loading Loading @@ -575,7 +575,7 @@ protected function sendPlaceholders(array $placeholders, array $placeholder_orde // - the attachments associated with the response are finalized, which // allows us to track the total set of asset libraries sent in the // initial HTML response plus all embedded AJAX responses sent so far. $fake_request->request->set('ajax_page_state', ['libraries' => implode(',', $cumulative_assets->getAlreadyLoadedLibraries())] + $cumulative_assets->getSettings()['ajaxPageState']); $fake_request->query->set('ajax_page_state', ['libraries' => implode(',', $cumulative_assets->getAlreadyLoadedLibraries())] + $cumulative_assets->getSettings()['ajaxPageState']); try { $ajax_response = $this->filterEmbeddedResponse($fake_request, $ajax_response); } Loading Loading
core/lib/Drupal/Core/Ajax/AjaxResponseAttachmentsProcessor.php +1 −1 Original line number Diff line number Diff line Loading @@ -132,7 +132,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->all('ajax_page_state'); $ajax_page_state = $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'); Loading
core/lib/Drupal/Core/Render/Element/RenderElement.php +2 −0 Original line number Diff line number Diff line Loading @@ -244,6 +244,7 @@ public static function processAjaxForm(&$element, FormStateInterface $form_state * - #ajax['event'] * - #ajax['prevent'] * - #ajax['url'] * - #ajax['type'] * - #ajax['callback'] * - #ajax['options'] * - #ajax['wrapper'] Loading Loading @@ -340,6 +341,7 @@ public static function preRenderAjaxForm($element) { // to be substantially different for a JavaScript triggered submission. $settings += [ 'url' => NULL, 'type' => 'POST', 'options' => ['query' => []], 'dialogType' => 'ajax', ]; Loading
core/lib/Drupal/Core/Theme/AjaxBasePageNegotiator.php +2 −2 Original line number Diff line number Diff line Loading @@ -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->all('ajax_page_state'); $ajax_page_state = $this->requestStack->getCurrentRequest()->get('ajax_page_state'); return !empty($ajax_page_state['theme']) && isset($ajax_page_state['theme_token']); } Loading @@ -73,7 +73,7 @@ public function applies(RouteMatchInterface $route_match) { * {@inheritdoc} */ public function determineActiveTheme(RouteMatchInterface $route_match) { $ajax_page_state = $this->requestStack->getCurrentRequest()->request->all('ajax_page_state'); $ajax_page_state = $this->requestStack->getCurrentRequest()->get('ajax_page_state'); $theme = $ajax_page_state['theme']; $token = $ajax_page_state['theme_token']; Loading
core/misc/ajax.js +9 −1 Original line number Diff line number Diff line Loading @@ -325,6 +325,13 @@ elementSettings.url = href; elementSettings.event = 'click'; } const type = $linkElement.data('ajax-type'); /** * In case of setting custom ajax type for link we rewrite ajax.type. */ if (type) { elementSettings.type = type; } Drupal.ajax(elementSettings); }); }; Loading Loading @@ -391,6 +398,7 @@ */ Drupal.Ajax = function (base, element, elementSettings) { const defaults = { type: 'POST', event: element ? 'mousedown' : null, keypress: true, selector: base ? `#${base}` : null, Loading Loading @@ -591,7 +599,7 @@ }, dataType: 'json', jsonp: false, type: 'POST', type: ajax.type, }; if (elementSettings.dialog) { Loading
core/modules/big_pipe/src/Render/BigPipe.php +2 −2 Original line number Diff line number Diff line Loading @@ -465,7 +465,7 @@ protected function sendNoJsPlaceholders($html, $no_js_placeholders, AttachedAsse // - the HTML to load the CSS can be rendered. // - the HTML to load the JS (at the top) can be rendered. $fake_request = $this->requestStack->getMainRequest()->duplicate(); $fake_request->request->set('ajax_page_state', ['libraries' => implode(',', $cumulative_assets->getAlreadyLoadedLibraries())]); $fake_request->query->set('ajax_page_state', ['libraries' => implode(',', $cumulative_assets->getAlreadyLoadedLibraries())]); try { $html_response = $this->filterEmbeddedResponse($fake_request, $html_response); } Loading Loading @@ -575,7 +575,7 @@ protected function sendPlaceholders(array $placeholders, array $placeholder_orde // - the attachments associated with the response are finalized, which // allows us to track the total set of asset libraries sent in the // initial HTML response plus all embedded AJAX responses sent so far. $fake_request->request->set('ajax_page_state', ['libraries' => implode(',', $cumulative_assets->getAlreadyLoadedLibraries())] + $cumulative_assets->getSettings()['ajaxPageState']); $fake_request->query->set('ajax_page_state', ['libraries' => implode(',', $cumulative_assets->getAlreadyLoadedLibraries())] + $cumulative_assets->getSettings()['ajaxPageState']); try { $ajax_response = $this->filterEmbeddedResponse($fake_request, $ajax_response); } Loading