Problem/Motivation

While working on a solution for media_library_opener leads to massive GET requests that break varnish, We discovered unexpected behaviour on the AjaxPageState object. After the page load and an Ajax request was made the theme in the AjaxPageState object had changed. This would lead to the use of different libraries in subsequent requests and should probably not be happening. We tracked the source of this change to the installed Yoast Seo module however other modules might have the same issue so an error when changing the theme that is used by Ajax should be considered.

Steps to reproduce

You should be able to reproduce this in a fresh project by installing the yoast_seo:^2.2 module.

  1. Create a page where the Yoast Seo module is active
  2. Before doing anything, make sure the drupalSettings.ajaxPageState.theme has the backend theme you would expect.
  3. Add content to the page and wait for the Yoast Seo module too make an Ajax request and receive a supply.
  4. Verify that the theme in drupalSettings.ajaxPageState.theme has changed

Proposed resolution

When updating the AjaxPageState settings with the new values a validation should be done that the theme is the same as the original theme.
We could also prevent the merge client side when the themes do not match.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#3 3607112-2.patch2.08 KBadebruin

Issue fork drupal-3607112

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

adebruin created an issue. See original summary.

adebruin’s picture

StatusFileSize
new2.08 KB

This is a patch file of the latest state of the MR for save usage with composer patches.

quietone’s picture

Version: 11.3.x-dev » main
Issue tags: -Ajax

Issues for Drupal core should be targeted to the 'main' branch, our primary development branch. Changes are made on the main branch first, and are then back ported as needed according to the Core change policies. The version the problem was discovered on should be stated in the issue summary Problem/Motivation section. Thanks.