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

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Task because this removes usages of a deprecated function.
Issue priority Not critical because the function in question is not to be removed in this release cycle.
Files: 
CommentFileSizeAuthor
#1 replace_drupal_render-2472791-1.patch704 bytesmitrpaka
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 91,391 pass(es). View

Comments

mitrpaka’s picture

Issue summary: View changes
FileSize
704 bytes
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 91,391 pass(es). View
JeroenT’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

No occurrences of drupal_render left in core/modules/link.

heddn’s picture

Can we make sure there is a test covering this render?

xjm’s picture

Status: Reviewed & tested by the community » Closed (duplicate)

Thanks for your work on this issue! Per discussion with @alexpott and @webchick, we should do these conversions in a single patch in #2393329: Replace all drupal_render calls with the service, and inject it, if possible.. The change will need to be postponed to 8.1.x at least since it is no longer an allowed change during the Drupal 8 beta. See #2393329-39: Replace all drupal_render calls with the service, and inject it, if possible..