Problem/Motivation
Similar to #3232018: Trigger a deprecation when using \Drupal\Core\Cache\RefinableCacheableDependencyTrait::addCacheableDependency with a non CacheableDependencyInterface object but for the renderer service.
If you call \Drupal\Core\Render\Renderer::addCacheableDependency with something that doesn't implement CacheableDependencyInterface, you end up with uncacheable pages.
Examples of bugs in core this has lead to include: #3227637: NodeController::revisionOverview is uncacheable and probably more.
Steps to reproduce
Call \Drupal\Core\Render\Renderer::addCacheableDependency with anything that doesn't implement CacheableDependencyInterface
Proposed resolution
Trigger a deprecation error if called with an object that doesn't implement CacheableDependencyInterface
In the next major version remove that deprecation error and add a type-hint (hard break).
Remaining tasks
All of the above
Issue fork drupal-3525388
Show commands
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:
- 3525388-trigger-a-deprecation
changes, plain diff MR !12175
Comments
Comment #3
acbramley commentedComment #4
acbramley commentedComment #5
smustgrave commentedThanks for already deprecating 11.3.
Deprecation seems correct and straight forward
LGTM
Comment #6
catchOne comment on the MR.
Comment #7
acbramley commentedFixed, since this is a trivial change I'm going to self RTBC.
Comment #9
catchCommitted/pushed to 11.x, thanks!