Replace RequestCloseSubscriber with needs_destruction tag on ModuleHandler

Created on 27 March 2024, 8 months ago
Updated 17 September 2024, about 2 months ago

Problem/Motivation

RequestCloseSubscriber has a curious comment and does exactly one thing on kernel terminate:

  /**
   * Performs end of request tasks.
   *
   * @todo The body of this function has just been copied almost verbatim from
   *   drupal_page_footer(). There's probably a lot in here that needs to get
   *   removed/changed. Also, if possible, do more light-weight shutdowns on
   *   AJAX requests.
   *
   * @param \Symfony\Component\HttpKernel\Event\TerminateEvent $event
   *   The Event to process.
   */
  public function onTerminate(TerminateEvent $event) {
    $this->moduleHandler->writeCache();
  }

Steps to reproduce

Proposed resolution

Move writeCache() to a destruct() method in ModuleHandler.
Tag ModuleHandler for needs_destruction.
Delete RequestCloseSubscriber.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Fixed

Version

10.3

Component
Base 

Last updated about 4 hours ago

Created by

🇬🇧United Kingdom longwave UK

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024