Requests are pushed onto the request stack twice, popped once

Created on 11 November 2015, over 8 years ago
Updated 31 December 2023, 6 months ago

Problem/Motivation

  • Symfony\Component\HttpKernel\HttpKernel::handleRaw() pushes $request onto the stack and Symfony\Component\HttpKernel\HttpKernel::finishRequest() pops it.
  • DrupalKernel::preHandle() also pushes $request onto the stack, but there's no matching pop.
  • As a result, at the conclusion of a subrequest, the stack still contains the subrequest. One consequence of this is that on a comment permalink page (e.g., /comment/1), drupalSettings.path.currentPath is 'node/1' instead of 'comment/1'. I don't know if there are other, more important, consequences.

Proposed resolution

Introduce RequestStackWrapper decorator for request_stack and pass it to http_kernel.basic instead of symfovy's one to be able to remove it in additional subscriber StackMiddlewareSubscriber runnig after KernelDestructionSubscriber

Sum-up in #2613044-85: Requests are pushed onto the request stack twice, popped once β†’

Remaining tasks

Get RTBC and commit

User interface changes

no

API changes

2 new services for core: decorator of request stack and stack clean-up after kernel destroyed

Data model changes

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
Request processingΒ  β†’

Last updated about 10 hours ago

No maintainer
Created by

πŸ‡ΊπŸ‡ΈUnited States effulgentsia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024