Skip to content

Replace deprecated static storage for Drupal 11.5 compatibility - #75

Merged
jjroelofs merged 1 commit into
1.xfrom
jur/1.x/drupal115-memory-cache
Oct 27, 2026
Merged

jjroelofs merged 1 commit into
1.xfrom
jur/1.x/drupal115-memory-cache

Conversation

@jjroelofs

@jjroelofs jjroelofs commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Drupal 11.5 deprecates drupal_static(), causing the compatibility check to fail on four calls in RL's response-cache handling and page-title preprocessing. Replace those calls with a shared, request-only MemoryCache service and add the response subscriber's array return type.

The service is owned by RL because Drupal 10.3, which the module supports, does not provide the newer cache.memory service. Both cache consumers receive it through dependency injection; page-title hooks use the same service. Overrides still update the response headers and Drupal cache metadata, then are consumed. The captured original title remains available to HTML preprocessing without persisting between requests.

This compatibility fix is independent of the reports UX change in #74. No test files or CI configuration changes are included.

Validation: Drupal/DrupalPractice coding standards and full-module PHPStan level 5 pass on Drupal 11.4.6 / PHP 8.3. Seventeen local runtime checks pass for absent/equal/longer/shorter/zero cache overrides, consumed overrides, disabled site caching, captured titles (including 0), site-name suffix preservation, and route-title fallback. The runtime checks are kept outside the repository. CI on 25ccaac passes all applicable checks, including Drupal 11.5 compatibility, Drupal lint, and the existing E2E suite.

Reference: Drupal's drupal_static() deprecation.

@jjroelofs
jjroelofs merged commit 5f12d6e into 1.x Oct 27, 2026
5 checks passed
@jjroelofs
jjroelofs deleted the jur/1.x/drupal115-memory-cache branch October 27, 2026 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant