Compressed ajax_page_state['libraries'] can exist in both $request->request and $request->query simultaneously

Created on 28 January 2025, 7 days ago

Problem/Motivation

πŸ“Œ Compress ajax_page_state Fixed added compression to the ajax_page_state['libraries'] and a middleware to uncompress it.
It first checks $request->request and uncompresses that.
If it wasn't found, it then checks $request->query and uncompresses that.

But what if it's in both? Then libraries are readded to the page. In the case of dialog.js, that leads to

Uncaught SyntaxError: Identifier 'DrupalDialogEvent' has already been declared (at dialog.js?v=11.2-dev:1:1)

Steps to reproduce

Add a modal dialog with an #ajax'd field at the same time
For example, in ✨ Use modals in field creation and field edit flow Needs work .

Proposed resolution

Uncompress the libraries in both places

Remaining tasks

Write tests

User interface changes

N/A

Introduced terminology

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component

ajax system

Created by

πŸ‡ΊπŸ‡ΈUnited States tim.plunkett Philadelphia

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024