Repository navigation
Replace deprecated static storage for Drupal 11.5 compatibility - #75
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-onlyMemoryCacheservice and add the response subscriber'sarrayreturn type.The service is owned by RL because Drupal 10.3, which the module supports, does not provide the newer
cache.memoryservice. 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 on25ccaacpasses all applicable checks, including Drupal 11.5 compatibility, Drupal lint, and the existing E2E suite.Reference: Drupal's
drupal_static()deprecation.