Parent issue #2393329: Replace all drupal_render calls with the service, and inject it, if possible.

Problem/Motivation

drupal_render() was marked as deprecated, though its still called in quite some places.

Proposed resolution

  1. Avoid rendering manually by letting the template who is printing the variable render it.
  2. Inject the renderer service into service, which uses drupal_render()
  3. Use \Drupal::service('renderer')->render() for old prodecural code.

Remaining tasks

  1. Find all the actionable fixes: Search for drupal_render(
  2. Create a Patch
  3. Review

User interface changes

None

API changes

None

Files: 
CommentFileSizeAuthor
#4 interdiff.txt7.18 KBwillzyx
#2 replace_all-2473385-2.patch7.66 KBwillzyx
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 91,398 pass(es). View
#1 replace_all-2473385-1.patch5.06 KBmitrpaka
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 91,396 pass(es). View

Comments

mitrpaka’s picture

Status: Active » Needs review
FileSize
5.06 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 91,396 pass(es). View
willzyx’s picture

FileSize
7.66 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 91,398 pass(es). View
mitrpaka’s picture

@willzyx: Could you please provide interdiff as well. Thanks.

willzyx’s picture

FileSize
7.18 KB

sure, sorry

webchick’s picture

Version: 8.0.x-dev » 8.1.x-dev
Status: Needs review » Closed (duplicate)

Thanks @willzyx for all your work on these! Unfortunately, these issues need to be postponed to 8.1.x at least. See the allowed beta changes policy and the comment in #2393329-39: Replace all drupal_render calls with the service, and inject it, if possible..