Closed (fixed)
Project:
Drupal core
Version:
11.x-dev
Component:
cache system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
24 Feb 2026 at 17:30 UTC
Updated:
2 Sep 2026 at 09:20 UTC
Jump to comment: Most recent
If you forget that CacheableMetadata::merge() doesn't alter the object it's called on, you potentially mess up your caching and could cause data exposure.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
andypostwould be great to move here https://git.drupalcode.org/project/drupal/-/merge_requests/14887
Comment #4
andypostComment #5
smustgrave commentedSorry no harm in being review but don't want to accidentally get reviewed. #3575572: Add [#NoDiscard] to Utility classes is determining if this is worth it.
Comment #6
prudloff commentedI agree this would be useful. It is an easy mistake to make and it can cause serious cache bugs.
Comment #7
andypostas policy approved
Comment #8
smustgrave commentedLGTM
Comment #11
godotislateCommitted and pushed a7b77cb to main. and 08901b4 to 11.x. Thanks!
Comment #13
wim leersVery nice! 🎉
I predict that when the ecosystem starts requiring PHP 8.5, that this core commit will single-handedly trigger a bunch of contrib modules security releases 🔮