Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
- Avoid rendering manually by letting the template who is printing the variable render it.
- Inject the renderer service into service, which uses drupal_render()
- Use \Drupal::service('renderer')->render() for old prodecural code.
Remaining tasks
- Find all the actionable fixes: Search for
drupal_render(
- Create a Patch
- Review
User interface changes
None
API changes
None
Comment | File | Size | Author |
---|---|---|---|
#1 | replace_all-2473777-1.patch | 2.72 KB | willzyx |
Comments
Comment #1
willzyx CreditAttribution: willzyx commentedComment #2
webchickThanks @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..