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.
- Create a page where the Yoast Seo module is active
- Before doing anything, make sure the
drupalSettings.ajaxPageState.themehas the backend theme you would expect. - Add content to the page and wait for the Yoast Seo module too make an Ajax request and receive a supply.
- 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
| Comment | File | Size | Author |
|---|
Issue fork drupal-3607112
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
Comment #3
adebruin commentedThis is a patch file of the latest state of the MR for save usage with composer patches.
Comment #4
quietone commentedIssues 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.