Problem/Motivation

Renderer::doRender() receives the render context as a required argument, but still retrieves and checks it again.

Background

The same lookup was already removed from the access-denied path in #2511330: Deprecate RendererInterface::render()'s sole $is_root_call parameter.

This is a followup to #2511330: Deprecate RendererInterface::render()'s sole $is_root_call parameter.

Proposed resolution

Remove the remaining redundant lookup and check.

Remaining tasks

Review.

User interface changes

None.

Introduced terminology

None.

API changes

None.

Data model changes

None.

Release notes snippet

n/a

Original report

Followup to #2511330: Deprecate RendererInterface::render()'s sole $is_root_call parameter.

Renderer::doRender() receives the render context as a required argument, but still retrieves and checks it again.

The same lookup was already removed from the access-denied path in #2511330: Deprecate RendererInterface::render()'s sole $is_root_call parameter.

Remove the remaining redundant lookup and check.

Issue fork drupal-3633353

Command icon 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:

Comments

pancho created an issue. See original summary.

pancho’s picture

Status: Active » Needs review
smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs issue summary update

This doesn't contain a proper issue summary.

pancho’s picture

Issue summary: View changes
Status: Needs work » Needs review
Issue tags: -Needs issue summary update
pancho’s picture

Issue summary: View changes
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Much better! Thank you

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

I searched contrib for an alternate renderer implementation that might break if we do this - found nothing (I did not expect to).

Committed and pushed 6c7f1ffe6fa to main. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • alexpott committed 6c7f1ffe on main
    task: #3633353 Remove redundant render context lookup in Renderer::...