Deprecate the "two double colons" check in Renderer::doCallback()

Created on 18 August 2014, over 10 years ago
Updated 23 August 2024, 5 months ago

Problem/Motivation

#2247779: Allow #pre_render, #post_render and #post_render_cache callbacks to be service methods β†’ made it possible to use service methods as #pre_render, #post_render and #post_render_cache callbacks.

Sadly, it includes this very confusing hack. dawehner said that this was necessary ( #2247779-12: Allow #pre_render, #post_render and #post_render_cache callbacks to be service methods β†’ ):

      if (strpos($callback, '::') == FALSE) {

This sadly is needed at the moment because there are callbables like 'Drupal\comment\CommentViewBuilder::attachNewCommentsLinkMetadata' which sadly don't implement ContainerFactoryInterface
but EntityControllerInterface

At the time we deferred clarifying this to a follow-up (because it blocked other issues), but we forgot to do so. This confusing check again surfaced in a code review of an unrelated patch at #2273277-19: Figure out a solution for the problematic interaction between the render system and the theme system when using #pre_render β†’ , point 2, so it's about time we fix this.

Proposed resolution

Remove this check if possible, otherwise at least clearly document it.

Remaining tasks

TBD

User interface changes

None.

API changes

None.

πŸ“Œ Task
Status

Closed: outdated

Version

11.0 πŸ”₯

Component
BaseΒ  β†’

Last updated about 5 hours ago

Created by

πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024